hello
i have Listview his name is listView1 i try to refresh my listview1 but that not work!!!
i just see the sam details and that no update.
i try this : listView1.Update() and also listView1.Refresh() and that not work!!!
the code here:
file EditSelectedItem.cs
private void button1_Click(object sender, EventArgs e)
{
EditData ed = new EditData(); // call for the form the open right now with the listview.
ed.TryIt(); // call for this function that update the listview
this.Close();
}
file EditData.cs // that open when i use the EditSelectedItem
public void TryIt()
{
..../
listView.Clear();
foreach (DataRow row in ds.Tables[0].Rows) // update listview1
{
ListViewItem item1 = new ListViewItem(c.ToString());
item1.SubItems.Add(row["Name"].ToString());
item1.SubItems.Add(row["LastName"].ToString());
item1.SubItems.Add(row["Password"].ToString());
item1.SubItems.Add(row["Notes"].ToString());
listView1.Items.Add(item1);
c++;
}
listView1.Refresh();
}
and the problem that i dont see the update in the listView1. whats the problem with my code?
thanks...