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.
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.
Hi Brain, I took a look at my previous look and I found something.
In my previous work, the wingrid's datasource is datatable and works fine with UpdateMode 'OnRowChangeOrLostFocus', and the current wingrid that having problem is a dataset.
On current wingrid, I only can get previous modification/update from the dataset after second modification/update.