Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
640
Selecting rows in a band
posted

What is the best way to format the same row in a given band. For example, I have two bands.  Band(1) will always have 3 rows in it.

 I want to make the first row always have a background color of AntiqueWhite and the third row always have a yellow background (among other things like making the second row updatable, etc).

 I tried the following, but it doesn't work properly, because the 'Not (e.Row.HasNextSibling)' does not eliminate the second row in the second 'if' statement'.

Protected Sub UltraWebGrid1_InitializeRow(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.RowEventArgs) Handles UltraWebGrid1.InitializeRow

If Not (e.Row.HasPrevSibling) And e.Row.Band.Index = 1 Then

e.Row.Style.BackColor = Drawing.Color.AntiqueWhite

e.Row.Style.ForeColor = Drawing.Color.Navy

End If

If Not (e.Row.HasNextSibling) And e.Row.Band.Index = 1 Then

e.Row.Style.BackColor = Drawing.Color.Yellow

e.Row.Style.ForeColor = Drawing.Color.Navy

End If

End Sub

 

Thanks!

 Chris

Parents
No Data
Reply Children
No Data