c# - Is there a way to set the BackColor of Winforms ListView cells individually? -
i want color each list view cell's backcolor using different color. possible?
to change colour of cell's backcolor
, can this:
listview1.items[0].useitemstyleforsubitems = false; listview1.items[0].subitems[0].backcolor = color.green; listview1.items[0].subitems[1].backcolor = color.orange; listview1.items[0].subitems[2].backcolor = color.red; // change 0 in items[0] whatever row want, // , 0, 1 or 2 in subitems[0] whatever column want.
the first line,
listview1.items[0].useitemstyleforsubitems = false;
will make row of cells not coloured same colour.
here demo picture:
hope helps!
Comments
Post a Comment