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
325
Template Add Row
posted

I have a BindingList bound to the grid.  When i click on the template add row, a new object is added to the binding list. If i go directly to clicking a save button, the list still contains the empty item.  The grid does not remove this empty item from the list unless I click somewhere else in the grid.  Is there a call I can make so the grid removes this empty item from my binding list or do I have to handle checking for empty items and removing them myself?  Thanks

Parents
No Data
Reply
  • 469350
    Offline posted

    What is your save button? If the button is a button control that takes focus, then the grid should take care of this automatically based on the UpdateMode property of the grid. By default, it will update on row change or lost focus. 

    I suspect your save button is probably a toolbar button and therefore does not take focus. So the grid doesn't know anything has happened. In which case, you will want to call grid.UpdateData before you do any kind of saving. 

Children