D
Derrick
Hello;
Sorry for being a little off topic. I've posted to the ADO.NET group as
well
Dealing with Winforms on 1.1 framework, VS.NET 2003.
I have a DataView (which is the Data Source for a DataGrid), and I want to
be able to delete rows only if specific columns contain specific values.
For example, one of the columns contains boolean values; if the value for
the row we are attempting to delete is true go ahead and delete it, but if
it's false cancel the delete.
I have a handler hooked to the DataTable.RowDeleting event (the DataTable is
obviously the source for my DataView), which supposedly fires before the row
is deleted. In there, I check my column conditions, but what I need to know
is what do I call to cancel the deletion? I've tried DataRow.RejectChanges,
DataRow.CancelEdit, and DataTable.RejectChanges to no avail - the row always
disappears from the DataGrid, so I assume the row is being deleted from the
view. I step through the event, so it is being triggered and my condition
checking is accurate.
I also tried doing stuff in the DataView.ListChanged
Thanks for your help;
Derrick
Sorry for being a little off topic. I've posted to the ADO.NET group as
well
Dealing with Winforms on 1.1 framework, VS.NET 2003.
I have a DataView (which is the Data Source for a DataGrid), and I want to
be able to delete rows only if specific columns contain specific values.
For example, one of the columns contains boolean values; if the value for
the row we are attempting to delete is true go ahead and delete it, but if
it's false cancel the delete.
I have a handler hooked to the DataTable.RowDeleting event (the DataTable is
obviously the source for my DataView), which supposedly fires before the row
is deleted. In there, I check my column conditions, but what I need to know
is what do I call to cancel the deletion? I've tried DataRow.RejectChanges,
DataRow.CancelEdit, and DataTable.RejectChanges to no avail - the row always
disappears from the DataGrid, so I assume the row is being deleted from the
view. I step through the event, so it is being triggered and my condition
checking is accurate.
I also tried doing stuff in the DataView.ListChanged
Thanks for your help;
Derrick