This project is read-only.

is it possible to set different backcolor for each row?

Jul 15, 2009 at 8:58 PM

it is known that general listview can be set with different backcolors for different rows, let's say alternative rows are with a same color,

but I can not find the backcolor function in sourcegrid control, is it possible to realize the function?


Jul 16, 2009 at 8:49 AM
Edited Jul 16, 2009 at 8:59 AM

As I know, you can't define a Row background color, but you can define the cell background color.

If you want 2 alternate colors, you can check if the row number is even or odd, for example:

if (row % 2 == 0)
  myGrid[row, column].View.BackColor = Color.Red
  myGrid[row, column].View.BackColor = Color.Blue