On Oct 9, 5:19 pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@comcast.netNoSpamM> wrote:
> Yes, you can use the Row binding event to alter the normal bind and do
> whatever you want. It is one of the easiest ways to set up conditional
> formatting of output.
>
> --
> Gregory A. Beamer
> MVP, MCP: +I, SE, SD, DBA
>
> *************************************************
> | Think outside the box!
> |
> *************************************************< tomh2...@gmail.com> wrote in message
>
> news: ups.com...
>
> > Hi,
> > Hi,
> > I have an ASP.NET 2005 application (using VB) with a GridView control
> > that needs to have the last 5 or 6 rows in Bold or maybe some other
> > special formatting. Most of the rows show monthly info but the last
> > few show other information. The gridview is bound to a stored
> > procedure that returns data something like this:
>
> > 'Jan 2007', 0
> > 'Feb 2007', 8
> > 'Mar 2007', 8
> > ...
> > 'Dec 2007', 0
> > 'Total Earned Hours', 120
> > 'Total Used Hours', 40
> > 'Total Earned as of today', 50
>
> > Is there a way to give the last 3 rows a different format, let's say
> > simply make the text bold in those rows? I've seen some discussion
> > about using a Footer row template, but obviously that won't work for
> > this case.
Thanks! I used the RowDataBound event and using the code below,
found I have access to all the row formatting properties. Just what I
needed
Here's my code
Protected Sub gvSummary_RowDataBound(ByVal sender As Object, ByVal e
As System.Web.UI.WebControls.GridViewRowEventArgs) Handles
gvSummary.RowDataBound
Dim args As GridViewRowEventArgs
args = DirectCast(e, GridViewRowEventArgs)
If args.Row.RowIndex > 12 Then 'or whatever criteria you want
args.Row.BackColor = Drawing.Color.DarkBlue
End If
End Sub
Thanks again
|