I have an UltraComboEditor inside an UltraGrid. The UltraComboEditor is not bound and I populate it using the Items.Add(UserId, DisplayName) method. I see my list of populated and when I go to choose a value from the list and click "Save" nothing persists in the objects/database. If I tab off the UltraComboEditor, the change is pushed to my object and persists. How do I allow the user to simply change the value and click Save to make it work?
The UltraGrid is bound to a BindingSource. I do EndEdits on the Save. The UltraComboEditor is NOT in EditMode at this point, because the control lost focus.
Me.UltraGrid2.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode) Me.UserBindingSource1.EndEdit()
Hello ,
UltraGrid is designed to apply changes made on a cell to the underlying data source when customer leave the cell or when leave the row. Based on your scenario it seems that your “Save” button is part of some Toolbar or MenuStip. Those type of components are designed on such way so that they cannot get the input focus. The result of this in your case is that Grid will not be forced to leave the active cell and the data will not be recoded to the underlying data source. So you should call UltraGrid.UpdateData() . Also you could review following forum thread, where similar issue was discussed:
http://ko.infragistics.com/community/forums/p/47347/253023.aspx#253023
Please let me know if you have any further questions.
That answer works, but I found that the naming convention used on this (not my) code was not good. EndEdits was not calling on the grid nor bindingsource I was attempting to save. I went with:
Private Sub EndEdits()
Me.UltraGrid1.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode)
Me.UserBindingSource.EndEdit()
Me.UltraGrid2.PerformAction(Infragistics.Win.UltraWinGrid.UltraGridAction.ExitEditMode)
Me.UserBindingSource1.EndEdit()
End Sub
I am glad to hear that you were able to solve your issue based on my suggestions.
Thank you for using Infragistics Components.