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.
Hello,
This happens because the 'UltraToolbarsManager' is a component and not a control, therefore it cannot receive focus. You need to put the focus to something else in order to exit edit mode the way you are trying to do this.
Hi Boris,
I now solved the problem by changing the datasource mode in advanced data bindings from "On Validation" to "OnPropertyChange". Then I get my changes.
Scenario is, when I have a texteditor on the form, I click into it and put in some text. Afterwards I click directly on a "save" button in the toolbars manager. So my text editor is still in edit mode and does not update the text I wrote. My dataset will never save the text I put in. So there has to be a way to leave edit mode of this text editor so that it commits the changes. I assume this problem occurs because the items in utm do not get focus. When I click on a normal button directly on the form this button becomes active and my text box loses its focus. So I have the data committed.
Thanks.
Hello Alex,
I am not sure what is your scenario exactly. Could you please if possible upload a small sample project reproducing this behavior and clarify the steps to reproduce it, I will be happy to take a look.
I have the same problem but not with the grid but with other controls on the form. When I try to save data in a texteditor on the grid It does not have the changes as long as I do not click out of the control. And on the texteditor I only have the .update() method and this does not work.
Any ideas how to solve this?
Thanks in advance,
Alex