I have a class that inherits a listviewitem. How do I force the listview to update the display?
Code:
public class AClass : System.Windows.Forms.ListViewItem
{
const string booltrue = "Yes";
const string boolfalse = "No";
private ListViewSubItem m_runninglv = new ListViewSubItem();
private bool m_running = false;
public bool Running
{
get { return m_running; }
set
{
m_running = value;
m_runninglv.Text = (m_running) ? booltrue : boolfalse;
}
}
public AClass()
{
this.SubItems[0] = m_runninglv;
}
}
When I change "AClass.Running" it doesn't update the text. Is there a way to force the listview to redraw the text? I tried ListView.Invalidate, etc but it didn't work.