listViewItem.BackColor not working
I'm using OwnerDraw = true, i'm not able t开发者_开发百科o change the BackColor of the item (i've got several SubItems also and ListView is set to Details view).
I'm not sure if this will help since the question is a little vague, but if you want to set the BackColor of SubItems you need to set UseItemStyleForSubItems = false
on the ListViewItem. OwnerDraw shouldn't make a difference.
Before u edit the style of the ListViewSubItem, Make sure to set the listview UseItemStyleForSubItems property to false:
p_lvi.UseItemStyleForSubItems = false;
p_lvi.SubItems[3 /*use your sub item index*/].BackColor = Color.Yellow;
and that's all... :)
you can visit: ListViewItem.BackColor Property (MSDN)
I think it help to you
精彩评论