Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
670
grid updatemode does not work with datatable
posted

hi,

I have a problem with the grid updatemode. No matter what I set the mode as, the underlying datatable still get updated as soon as cell update event.

what i need to do :-

compare the value of  columns before and after row update.

cannot do this in cell update event because i need to compare multiple columns at one time.

cannot use cell original value because it always keep the last value changed, not the most current value before row update.

tried to use before row update, but no idea how to get the respective cells value before the update

any idea ?

thanks

Parents
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    If you set UpdateMode to OnRowChange or OnRowChangeOrLostFocus, then you could use BeforeRowUpdate to compare the values in the cells to the values in the underlying data source.

    To get the object in the data source that the grid row represents, you use the ListObject property on the row. If you are using a DataTable, then the ListObject property will return a DataRowView, which has a Row property on it, so you can get the DataRow and examine it's data and compare that to the Value of the cells in the grid row.

Reply Children