G
Guest
Msdn documentation states that setting DataSet EnforceConstraints to false
should prevent RowChanging event from firing when the table is filled but it
does fire. Is this a bug?
My example is a simple Windows Forms application created by drag and drop to
display the contents of a simple SQL Server table in a DataGridView. The form
code is as follows:
private TestDataSet.TestTableDataTable mfldTestTable;
public FormTest()
{
InitializeComponent();
mfldTestTable = mctlTestDataSet.TestTable;
mfldTestTable.RowChanging += new
DataRowChangeEventHandler(mfldTestTable_RowChanging);
}
private void FormTest_Load(object sender, EventArgs e)
{
mctlTestDataSet.EnforceConstraints = false;
this.mctlTestTableTableAdapter.Fill(this.mctlTestDataSet.TestTable);
mctlTestDataSet.EnforceConstraints = true;
}
private void mfldTestTable_RowChanging(object sender, DataRowChangeEventArgs
e)
{
// Do Stuff
}
Thanks for any clarification regarding this matter.
should prevent RowChanging event from firing when the table is filled but it
does fire. Is this a bug?
My example is a simple Windows Forms application created by drag and drop to
display the contents of a simple SQL Server table in a DataGridView. The form
code is as follows:
private TestDataSet.TestTableDataTable mfldTestTable;
public FormTest()
{
InitializeComponent();
mfldTestTable = mctlTestDataSet.TestTable;
mfldTestTable.RowChanging += new
DataRowChangeEventHandler(mfldTestTable_RowChanging);
}
private void FormTest_Load(object sender, EventArgs e)
{
mctlTestDataSet.EnforceConstraints = false;
this.mctlTestTableTableAdapter.Fill(this.mctlTestDataSet.TestTable);
mctlTestDataSet.EnforceConstraints = true;
}
private void mfldTestTable_RowChanging(object sender, DataRowChangeEventArgs
e)
{
// Do Stuff
}
Thanks for any clarification regarding this matter.