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
20
Checking for data change in ultragrid when the row wasn't changed
posted

I am trying to check to see if data in my ultragrid has changed.  I am doing this if the user closes the window, so that we can save the data automatically.  I check the data set "HasChanges" and am getting False even though data in a cell was changed.  What I have noticed is that this only occurs if the user has not clicked on another row in the ultragrid; if they do so, then I get True.  So it seems that unless you move to another row in the ultragrid the dataset will not be updated.

Is there a way for me to tell if they have made edits to data and not moved to another row?

Parents
No Data
Reply
  • 37774
    Suggested Answer
    posted

    The grid generally commits the data to the underlying source based on the UpdateMode property, which defaults to OnRowChangeOrLostFocus.  If you want to force the active row to be updated before you try to update your data source, you could do something like:

    if (this.ultraGrid1.ActiveRow != null)
        this.ultraGrid1.ActiveRow.Update();

    -Matt

Children