
Signature
Jim
"Remember, an amateur built the Ark; professionals built the Titanic."
My datagrid is editable which means all cells in all rows are textbox
instead of label. So, at any time, the data can be changed. When the field
is updated, OnTextChanged event fires and the data is saved to datatable
first. So, even I set the cancel button causes validation to false, the
OnTextChanged event still fires and so error occurs since the datatype
mis-matched from the datatable. I must have the OnTextChanged event,
otherwise all changed event may be lost on next postback.
> I may be missing something but why not:
> 1. Disable validation for your cancel button (set the property "Causes
[quoted text clipped - 12 lines]
> > click event. So, is there a way to solve it?
> > Thanks
Jim Nugent - 27 Aug 2003 14:16 GMT
There are a couple of ways around this I think.
The first one I KNOW works because we use it:
1. Have an edit linkbutton in the first column of your grid. In the
linkbutton command handler, grab the data and put up a different page with
that data in a text box and allow it to be edited. It's more elegant IMHO
anyway and allows you to have textboxes and dropdown lists, etc. if
appopriate for your grid columns. Have save and cancel available. Save (on
the "edit" page) updates that row of the table; cancel bails out without
firing the validator.
2. Let the grid edits modify your DataSet object (in memory), and save out
your DataSet to to the DB table at one in the save handler. Each row in your
ds has a RowChanged (or something like that) property so you can even get
efficient and only update the ones that need it.

Signature
Jim
"Remember, an amateur built the Ark; professionals built the Titanic."
> My datagrid is editable which means all cells in all rows are textbox
> instead of label. So, at any time, the data can be changed. When the field
[quoted text clipped - 24 lines]
> > > click event. So, is there a way to solve it?
> > > Thanks