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
770
insert value into wingrid but the datasource not updated?
posted

Hi guys.

I have a wingrid with two related tables, and user can edit the value in second table.

The wingrid's UpdateMode is set to OnRowChangeOrLostFocus.

 

I edited a value in a cell, then it will fire CellChange event to do some calculation.

Unfortunately, when I look into the datasource of the wingrid, the value is not updated.

 

Please advice.

Parents
No Data
Reply
  • 69832
    Offline posted

    If I followed this correctly, you are interpreting the 'OnRowChangeOrLostFocus' setting as meaning that the data source is updated when a cell value in the row changes, but the term 'change' in that context means when the ActiveRow changes, i.e., when the user navigates to a different row.

    You can get the behavior you are expecting here by setting UpdateMode to 'OnUpdate', and then calling the Update method in response to CellChange. This, however, is usually not a good idea because (a) it might cause performance issues since the data source is being updated continually and (b) you can't support rollbacks, like when the user presses escape to restore the previous value.

    Note that the 'OnCellCHange' settings for UpdateMode will cause an update when the user leaves the cell, so you might want to consider using that.

Children