I'm experimenting with strongly typed datasets, and when the .Fill method is
called, the RowChanging fires for each row. This causes a problem when the
existing data does not adhere to the rules outlined in the RowChanging
method. Is there an easy way to not have the RowChanging event occur when
the dataset is being filled?
Example code is
daTitleAuthor.F ill(dsAuthors1) ;
private void tblTitleAuthor_ RowChanging(obj ect sender,
dsAuthors.title authorRowChange Event e) {
if ( !e.Row.Isroyalt yperNull() ) {
if ( (e.Action == DataRowAction.A dd || e.Action == DataRowAction.C hange)
&& e.Row.royaltype r > 10) {
throw new Exception("Roya lty cannot be greater than 10");
}
}
}
called, the RowChanging fires for each row. This causes a problem when the
existing data does not adhere to the rules outlined in the RowChanging
method. Is there an easy way to not have the RowChanging event occur when
the dataset is being filled?
Example code is
daTitleAuthor.F ill(dsAuthors1) ;
private void tblTitleAuthor_ RowChanging(obj ect sender,
dsAuthors.title authorRowChange Event e) {
if ( !e.Row.Isroyalt yperNull() ) {
if ( (e.Action == DataRowAction.A dd || e.Action == DataRowAction.C hange)
&& e.Row.royaltype r > 10) {
throw new Exception("Roya lty cannot be greater than 10");
}
}
}
Comment