Changing the colour of certain ListView columns

15,487

Try something like this:

ListViewItem item1 = new ListViewItem( "Item 1"); 
item1.SubItems.Add( "Color" ); 
item1.SubItems[1].ForeColor = System.Drawing.Color.Blue;
item1.UseItemStyleForSubItems = false; 
listView1.Items.Add( item1 ); 

If you are using database to bind it you may have to do this during on item databind process. Let me know if that's the case.

Share:
15,487
deepseapanda
Author by

deepseapanda

Updated on June 27, 2022

Comments

  • deepseapanda
    deepseapanda almost 2 years

    How can I change the colour of a specific column in a listview?

    string[] row = { appID[i], "Launch Game"}; // more data to add
    
    listView1.Items.Add(nameArray[i], i).SubItems.AddRange(row);
    
    listView1.ForeColor = System.Drawing.Color.Blue;