Home Forums WinForms controls Xceed Grid for WinForms Help on row color Reply To: Help on row color

User (Old forums)
Member
Post count: 23064

If you’re working in VB.NET, copy this into the grids AddingDataRow event:

If (e.DataRow.Index Mod 2) = 0 Then
e.DataRow.BackColor = Color.White
Else
e.DataRow.BackColor = Color.Yellow
End If

and it should give you the idea.

If it helps (e.DataRow.Index Mod 2) works out if the rows index is odd (returns 1) or even (return 0), then colours then accordingly.

can’t help if you’re working in C# though, anyone….

Imported from legacy forums. Posted by Dr Unken (had 420 views)