digdug

how can i change the backcolor of an entire column in a listview


Re: Visual C# Express Edition how to change the backcolor of the entire column in a listview?

Sushil B

There is no direct option to achive this functionality, however you could use the code similar to the following to achive the same by setting the UseItemStyleForSubItems to False:

//To set 2nd Column BackColor

foreach (ListViewItem lvwItem in listView1.Items)

{

lvwItem.UseItemStyleForSubItems = false;

lvwItem.SubItems[1].BackColor = Color.Red;

}

- Sushil






Re: Visual C# Express Edition how to change the backcolor of the entire column in a listview?

digdug

cool!.. now im able to change the forecolor of an entire columns too.. thanks sushil!