Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
240
Ultragrid and dropdown value lists
posted

Greetings,

       I am developing a VB .NET form that includes an Ultra Grid that contains child information.   For one of the columns on the grid, I am using a value list set up as a dropdown list so users can only enter what is in the list.   One thing I noticed in testing is once an item is selected in the drop down, the cell does not lose focus.   The problem this causes is if the user hits save, the grid does not recognize the selected value and it is not saved to the database.   The work around is to manually tab off the cell so the value is now is now recognized by the grid.

      Is there a way to force a move off the cell once a value is selected from the drop down list so the data it contains is recognized by the grid and can be properly saved?

Thanks

  • 3565
    Suggested Answer
    posted

    What you have to do before saving is to notify the grid that it needs to accept the current edits that the user had made. The problem you are having is that the row the user is editing is still in edit mode and the changes haven't been submitted back to the data source. I'm assuming you have the grid's update mode set to OnCellChangeOrLostFocus so it submits updates after each cell is changed so moving to focus is an artificial way of getting your updates submitted.

    If I'm not mistaken you can call the EndUpdate method against the grid or probably better would be to call EndEdit on your binding source assuming you are using one for the grid.