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
330
Commiting changes from grid edits when a tool item is clicked without tabbing off the cell
posted

I am experiencing bad behavior when editing a cell on a grid and clicking a tool item without first pressing enter or tabbing off of the cell.  A blank is being written to the underlying table field.  Is there a way to commit all current changes to all cells on the grid before another event causes the table saves the current record?

Parents
No Data
Reply
  • 22852
    Offline posted

    Tim,

    The issue that you are seeing is because of a behavior of tool bars and menus where they don't get focus which is necessary if you have tools or menu items that do things like copy and paste since the focus needs to remain on the control that you want to take that action on.  The WinGrid by design commits changes to a cell when the user leaves the cell and this is necessary because if you attempted to commit on every keystroke it could cause other issues where exceptions may be thrown if the incomplete data isn't valid.

    To solve this issue in your application you will need to manually cause the updates to the cell to be committed.  You can call grid.PerformAction(UltraGridAction.CommitRow) to force this to happen.

    Let me know if you have any questions with this matter.

Children
No Data