I have a simple winform with the following code.
But although I can read back the info, the display fails
to provide the text or the cell background color changes.
private void ListViewBroke()
{
listView.View = View.Details;
ArrayList LVcolTitles= new ArrayList();
LVcolTitles.Add ("Drive");
LVcolTitles.Add ("Cust");
int [] LVcolWidths = {50,50};
for(int i = 0;i< LVcolTitles.Cou nt;i++)
{
listView.Column s.Add(LVcolTitl es[i].ToString() ,
LVcolWidths[i], HorizontalAlign ment.Center);
} // columns load, data and color missing !!!
ListViewItem item1 = new ListViewItem("D ");
item1.SubItems. Add("TEST");
listView.Refres h();
item1.SubItems[0].BackColor=Syst em.Drawing.Colo r.Turquoise;
item1.SubItems[1].BackColor=Syst em.Drawing.Colo r.Tomato;
Console.WriteLi ne(item1.SubIte ms[0].Text + " " +
item1.SubItems[1].Text);
listView.Refres h();
}
Any ideas ? Thanks
But although I can read back the info, the display fails
to provide the text or the cell background color changes.
private void ListViewBroke()
{
listView.View = View.Details;
ArrayList LVcolTitles= new ArrayList();
LVcolTitles.Add ("Drive");
LVcolTitles.Add ("Cust");
int [] LVcolWidths = {50,50};
for(int i = 0;i< LVcolTitles.Cou nt;i++)
{
listView.Column s.Add(LVcolTitl es[i].ToString() ,
LVcolWidths[i], HorizontalAlign ment.Center);
} // columns load, data and color missing !!!
ListViewItem item1 = new ListViewItem("D ");
item1.SubItems. Add("TEST");
listView.Refres h();
item1.SubItems[0].BackColor=Syst em.Drawing.Colo r.Turquoise;
item1.SubItems[1].BackColor=Syst em.Drawing.Colo r.Tomato;
Console.WriteLi ne(item1.SubIte ms[0].Text + " " +
item1.SubItems[1].Text);
listView.Refres h();
}
Any ideas ? Thanks
Comment