I want that when I insert or update records in another form (Form2
), the DataGridView
on Form1
should automatically refresh (call btnRefresh
) after each operation or preferably wait until all change operations have finished, and update the DataGridView
form Form2
's closing event with all changes.
I believe in VB.NET this is achieved with Form1.DataGridView.Refresh
, but I am not sure in C#. I was told that I pass the reference of the DataGridView
on Form1
to Form2
using properties but since I'm new to C#, I didn't know how to. How can I resolve this issue?
My refresh button code:
private void btnRefresh_Click(object sender, EventArgs e)
{
GVThesis.DataSource = thesisRepository.GetThesis();
GVThesis.Refresh();
}