Welcome to the Xceed Community | Help
Community Search  
More Search Options

How do you detect cell changes in the EditEnded event?

Sort Posts: Previous Next
  •  04-13-2012, 5:22 AM Post no. 31982

    How do you detect cell changes in the EditEnded event?

    Hi. I have a DataGrid with a few columns that are editable. I'm catching the EditEnded event for such a cell, and can get the row and thereby also my business object that was modified.

    However, if the user just clicks in one of the editable cells and then leaves the cell again without changing anything, the EditEnded event fires as well. So in order to avoid a roundtrip to my DB in these cases, I need to somehow detect whether the data in the edited cell has truly changed. Does anyone have a good tip on how to do this?

    Of course, I could store the row/object being edited in the EditBegun event, and then do a (deep) comparison between the two objects in the EditEnded event, but it feels a bit "heavy". Maybe there is a way to get to the old/previous value of a cell being edited?

  •  04-13-2012, 4:14 PM Post no. 31987 in reply to 31982

    Re: How do you detect cell changes in the EditEnded event?

    Hi Thomas,

    You can use the IsDirty flag on the sender (DataCell) in your EditEnded event to check if the value was changed.

    Documentation:
    http://doc.xceedsoft.com/products/XceedWpfDataGrid/Xceed.Wpf.DataGrid.v4.3~Xceed.Wpf.DataGrid.Cell~IsDirty.html

     


    ** Quick Tip: Clients with an active support subscription should be sending their questions by email if they wish to benefit from the faster response time. Thanks!


    Diane Lafontaine
    Technical Support
    Xceed Software Inc.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.