Here is a snippet of code from the edit form exit button which is suppose to be doing the refreshing:
MessageBox.Show("Client successfully edited");
Client.DisplayClients(Clients.clients, mForm.DataGridViewProp);
mForm.DataGridViewProp.EndEdit();
mForm.DataGridViewProp.Refresh();
mForm.DataPanel.Refresh();
this.Close();
mForm is an instance of the main form:
private mainForm mForm = new mainForm();
Clients.clients is a List within a class, and DisplayClients is a method within the client class:
mForm is an instance of the main form:
private mainForm mForm = new mainForm();
Clients.clients is a List within a class, and DisplayClients is a method within the client class:
public static void DisplayClients(List cList, DataGridView dgv)
{
dgv.Rows.Clear();
foreach (Client c in cList)
{
dgv.Rows.Add(c.id_, c.firstName_, c.lastName_, c.homeAddress_, c.workAddress_,
c.emailAddress_, c.homePhoneNumber_, c.cellPhoneNumber_);
}
}
Any help on the matter is greatly appreciated.
Thanks,
Ari
Any help on the matter is greatly appreciated.
Thanks,
Ari
Sam HobbsPosted Dec 2, 2011, 10:04 PM
AriPosted Dec 2, 2011, 9:46 PM
And is done so using the datasource property.
Sam HobbsPosted Dec 2, 2011, 9:35 PM
Assuming that the DataGridView is bound using a TableAdapter, then is it possible to edit the data using the same TableAdapter that is used for the DataGridView? If that is possible, then that is the ideal solution. Otherwise there are other possibilities of course but first consider this first possibility.