This should work Einar ... I do it all the time, no Refresh necessary. Where are you executing this code? In an event handler or what? (not that it matters, but I'm just trying to figure out why it's not working)
~~Bonnie
>I have a listview that I have filled with items and sub items. Then I want to change the test of a subitem and I use the following code:
>
>this.listView1.Items[0].SubItems[1].Text = "Hi there";
>
>
>Then I issue the following code to see if it changed:
>
>MessageBox.Show(this.listView1.Items[0].SubItems[1].Text);
>
>
>The messagebox displays "Hi There" and I think all is good, but all is not good, because the listview is still displaying the original value. I tried adding this.listView1.Refresh(); after the code where I change the text but that does not help.
>
>Any thoughts on the subject?
>
>Einar
>
>UPDATE:
>I figured out a way that works, but it seems like a lot of work for such a trivial task:
>
>ListViewItem lvi;
>ListViewItem.ListViewSubItem lvsi;
>
>this.listView1.BeginUpdate();
>
>lvi = new ListViewItem();
>lvi.Text = this.listView1.Items[0].Text;
>
>lvsi = new ListViewItem.ListViewSubItem();
>lvsi.Text = "Hi There";
>
>lvi.SubItems.Add(lvsi);
>this.listView1.Items[0] = lvi;
>this.listView1.EndUpdate();
>