Hi,
I've developped of form containing an Infragistics WinGrid who displays a list of words. Above that list, I've placed a "UltraToolbarsManager" who contains three items ("add", "save" and "delete" buttons) and below i've put a button to exit the form.
I allow to the user to update rows directly, by selecting a row. Everything works fine here.
The problem I had is when I try to save the data contained in the grid using the "save" button on the "UltraToolbarsManager" just after I've made some changes on the grid data (without quitting the updated cell).
I use the "AfterRowUpdate" event to test if the user made some changes on the grid data. The problem with this event, it's that is only triggered after the user has selected another row of the grid or if the user click on another control on the form but not another Infragistics control like the UltraToolbar.
If the user change a string in the grid (without selecting another gridrow after the changes) and click on the "Ok" button (to close the form) the "AfterRowUpdate" event will be triggered and my save function will work as it should. But, if the user do the same change (without selecting another gridrow after the changes) and it click on the save button of the UltraToolbar the "AfterRowUpdate" is not triggered and my save method won't work for the last updated string.
Does anyone knows how to solve this problem???
(I've found a workaround : On the click of the save button I force the selected row to another row so the "AfterRowUpdate" is trigger... (I'm not sure it's a good way to solve the problem!!! )
When the grid commits the changes is determined by the UpdateMode. By default, the grid will save the changes when it loses focus or the active cell changes.
A Toolbar button does not take focus, though. So when you click your toolbar button, the grid neither loses focus nor changes active cells. So you have to manually force the grid to update. The easiest way to do this is to call the UpdateData method on the grid before you try to save.
Mike Saltzman"] When the grid commits the changes is determined by the UpdateMode. By default, the grid will save the changes when it loses focus or the active cell changes. A Toolbar button does not take focus, though. So when you click your toolbar button, the grid neither loses focus nor changes active cells. So you have to manually force the grid to update. The easiest way to do this is to call the UpdateData method on the grid before you try to save.
Thanks a lot!. This is what I was looking for too.
It works, thanks!!!