J
Jonathan Wood
Can anyone tell me what's happening here.
I have a Windows form with a docked DataGridView. The following handler
handles a click on a toolbar button:
private void toolRun_Click(object sender, EventArgs e)
{
using (DataGridView grd = customersDataGridView)
{
for (int i = 0; i < grd.Rows.Count; i++)
{
object o = grd["CustAmount", i].Value;
if (o != null)
MessageBox.Show(o.ToString());
o = grd["CustEmail", i].Value;
if (o != null)
MessageBox.Show(o.ToString());
}
}
}
It behaves exactly as expected, but when it's finished, the DataGridView
disappears from the form! I'm just left with a blank form with only my menu
and toolbars.
Any ideas?
I have a Windows form with a docked DataGridView. The following handler
handles a click on a toolbar button:
private void toolRun_Click(object sender, EventArgs e)
{
using (DataGridView grd = customersDataGridView)
{
for (int i = 0; i < grd.Rows.Count; i++)
{
object o = grd["CustAmount", i].Value;
if (o != null)
MessageBox.Show(o.ToString());
o = grd["CustEmail", i].Value;
if (o != null)
MessageBox.Show(o.ToString());
}
}
}
It behaves exactly as expected, but when it's finished, the DataGridView
disappears from the form! I'm just left with a blank form with only my menu
and toolbars.
Any ideas?