@Mohammad , Welcome to Microsoft Q&A, you could try to refer to reza's suggestion to use load data to refresh the data.
Here is a code example you could refer to.
Update Form1 edit button click:
public int Age { get; set; }
public string SName { get; set; }
public int Id { get; set; }
public DataGridView gridView { get; set; }
private void btn_Edit_Click(object sender, EventArgs e)
{
int index = dataGridView1.CurrentRow.Index;
Age = Convert.ToInt32(dataGridView1.Rows[index].Cells["Age"].Value);
Id= Convert.ToInt32(dataGridView1.Rows[index].Cells["Id"].Value);
SName = dataGridView1.Rows[index].Cells["Name"].Value.ToString();
gridView = dataGridView1;
Form2 form2 = new Form2();
form2.Show();
}
Form2:
Tested result:
Hope the above code could help you.
Best Regards,
Jack
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.