Grid and DataTable
I am working with a Grid to let the user manipulate a UserTable.
I filled the Grid with the usual ExecuteQuery method and added some code to update the UserTable.
All works fine but there is also a little problem:
If the user click on a cell, do some change to the cell value and click the Update button, without exiting from the modified cell, this last value seems not to reflect in the DataTable associated to the Grid, so the update failed.
The strange thing is that if the user exit from the cell, pressing TAB for instance, and then click on the update button the cell value contains the last string typed in it.
Somebody knows if there is a method to update the Grid/DataTable contents to reflect the last changes ?
Thanks in advance
Massimiliano LuppisAlso I noted another problem:
if the user do same changes to grid cells value, immediately the form mode switch from OK to Update and the first button changes its caption to reflect the new form mode.
This is fine for me because it allows to manage the User Table with little code.
However when the user click the Remove Data Menu, I delete the current row from the grid but this event seems not to be reflected in the form mode, so I have to changes the form mode to Update manually.
Is there a method to let the grid switch form mode automatically as is the case with cell value changes ?
Any help will be appreciated.
Adrian MeierHi Massimiliano
The best way to be sure, that the value is also written to the datatable, is to listen for the Validate-Event in After-Mode. If you want to be sure.
If you cannot handle Update/OK-Mode with the property AffectsFormMode you have to set the form mode manually.
Massimiliano LuppisYeah, the Validate event works perfectly to catch modified cell values, also if the user don't move out of the cell.
Thank you Adrian !