I previously had a form that called another form that had a datagridview on it. I passed a DataTable to the child form and on the childform it bound it.
Parent calls child form and shows it.
TableInfoti = new TableInfo();
t1.Show();
Parent passes Datatable:
t1.ShowDataGrid(dt);
Child binds it to datagrid:
public void showDataGrid(DataTable dt, string type)
{
dgvTableColumns.DataSource = dt;
}
This works perfect.
But now I want to make this a modal form, so I change the t1.Show() to t1.ShowDialog() or t1.ShowDialog(this)
Now the grid is showing nothing on the Child form.
But if I change the code to do the ShowDialog after I call ShowGridView(), it works fine.
TableInfoti = new TableInfo();
t1.ShowDataGrid(dt);
t1.ShowDialog();
Why is the behavior different?
Thanks,
Tom
Parent calls child form and shows it.
TableInfoti = new TableInfo();
t1.Show();
Parent passes Datatable:
t1.ShowDataGrid(dt);
Child binds it to datagrid:
public void showDataGrid(DataTable dt, string type)
{
dgvTableColumns.DataSource = dt;
}
This works perfect.
But now I want to make this a modal form, so I change the t1.Show() to t1.ShowDialog() or t1.ShowDialog(this)
Now the grid is showing nothing on the Child form.
But if I change the code to do the ShowDialog after I call ShowGridView(), it works fine.
TableInfoti = new TableInfo();
t1.ShowDataGrid(dt);
t1.ShowDialog();
Why is the behavior different?
Thanks,
Tom