Hello, I have a form with datagridview and a List like this:
private void Form1_Load(object sender, EventArgs e)
{
List<Person> list = new List<Person>();
list.Add(new Person("A", "An Giang"));
list.Add(new Person("B", "TP HCM"));
list.Add(new Person("C", "Tiền Giang"));
list.Add(new Person("D", "Cần Thơ"));
this.dataGridView1.DataSource = list;
list.Add(new Person("E", "Bạc Liêu")); // --> changed
this.dataGridView1.EndEdit();
this.dataGridView1.Refresh();
this.Refresh();
this.dataGridView1.Parent.Refresh();
}
My problem is the datagridview didn't show the new row although its Datasource had changed. I try to refresh the datagrid but it did not work.