J
John Braganca
I have a modal form that takes a typed dataset and binds some of its
comboboxes to it. Before i call ShowDialog() the dataset is just fine.
In the OnLoad event the dataset is null. This is driving me crazy.
Any help would be greatly appreciated!
Skeleton code below:
class MyForm : System.Windows.Forms.Form
{
protected TypedDataSet ds;
MyForm()
{
myDialog = new MyDialog();
}
override OnLoad(EventArgs e)
{
ds = myDialog.DS = GetDS();
base.OnLoad(e);
}
private void Button_Click(object sender, EventArgs e)
{
//myDialog.DS is not null here
myDialog.ShowDialog(this);
}
}
class MyDialog : System.Winows.Forms.Form
{
public TypedDataSet DS;
override OnLoad(EventArgs e)
{
comboBox1.DataSource = new DataView(DS.Tables[0]); // DS is
null here???
}
}
comboboxes to it. Before i call ShowDialog() the dataset is just fine.
In the OnLoad event the dataset is null. This is driving me crazy.
Any help would be greatly appreciated!
Skeleton code below:
class MyForm : System.Windows.Forms.Form
{
protected TypedDataSet ds;
MyForm()
{
myDialog = new MyDialog();
}
override OnLoad(EventArgs e)
{
ds = myDialog.DS = GetDS();
base.OnLoad(e);
}
private void Button_Click(object sender, EventArgs e)
{
//myDialog.DS is not null here
myDialog.ShowDialog(this);
}
}
class MyDialog : System.Winows.Forms.Form
{
public TypedDataSet DS;
override OnLoad(EventArgs e)
{
comboBox1.DataSource = new DataView(DS.Tables[0]); // DS is
null here???
}
}