D
Daniel Carlsson
Im having a bit of a problem with a typed DataSet thats
bound to a DataGrid (Forms). The problem is that I dont
want to allow the user to delete or change certain rows.
According to the documentation:
"The ColumnChanging, RowChanging, and RowDeleting events
are raised during the update process. You can use these
events to validate data or perform other types of
processing. Because the updates are in process during
these events, you can cancel the update by throwing an
exception, which prevents the change from being completed."
So I simply made an eventhandler for RowDeleting on the
proper table and did:
Throw New Exception("Cancel")
Which according to the documentation and all the examples
Ive found in the documentation is the right way to do it.
While this *does* keep the user from deleting the row it
also closes down the application, apparantly there isnt
any Try ... Catch phrase in the proper place in the
Framework code..
So how am I supposed to hinder the user from deleting
random rows then? The DataGrid doesnt fire off any
relevant events and listening in on the dataset's events
seems a bit futile since I cant stop it from happening
anyways..
Thanks in advance,
Dan
bound to a DataGrid (Forms). The problem is that I dont
want to allow the user to delete or change certain rows.
According to the documentation:
"The ColumnChanging, RowChanging, and RowDeleting events
are raised during the update process. You can use these
events to validate data or perform other types of
processing. Because the updates are in process during
these events, you can cancel the update by throwing an
exception, which prevents the change from being completed."
So I simply made an eventhandler for RowDeleting on the
proper table and did:
Throw New Exception("Cancel")
Which according to the documentation and all the examples
Ive found in the documentation is the right way to do it.
While this *does* keep the user from deleting the row it
also closes down the application, apparantly there isnt
any Try ... Catch phrase in the proper place in the
Framework code..
So how am I supposed to hinder the user from deleting
random rows then? The DataGrid doesnt fire off any
relevant events and listening in on the dataset's events
seems a bit futile since I cant stop it from happening
anyways..
Thanks in advance,
Dan