I have this datagridview in a windowform, i do have a button that is supposed to add a new row to the datagridview, so when i click on it it opens up a new window form, how do i save the data from my current window form and update the datagrid view?
The datagrid is populated from a list, like this:
public void GetUserDetails()
{
List<xml.UserDescriptor> users = new List<xml.UserDescriptor>();
foreach (xml.UserDescriptor dbList in xmlData.Users)
{
if (dbList.DatabaseDescriptorName == name)
{
users.Add(new xml.UserDescriptor() { DatabaseDescriptorName = dbList.DatabaseDescriptorName, Username = dbList.Username, Password = dbList.Password, IsAdmin = dbList.IsAdmin });
}
}
dataGridView3.DataSource = users;
}
How do i save the data i inserted in the new form and after closing it a new row should appear in the datagridview.
Please any help would be appreciated.