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
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.
Hi Mike,
Yes the save button is on the toolbar. In the toolclick event, I calll grid.UpdateData() but there is no change in the number of rows in my list. I still get the blank row
Hm, that's odd. What version of the grid are you using? Maybe this is a bug and you need to get the latest Hot Fix.
Another option would be to check the grid.ActiveRow.IsUnmodifiedTemplateAddRow and if that returns true, call CancelUpdate on that row.
You should check and see if there is a newer hot fix available. I'm not sure, I haven't memorized all the numbers, but that number seems kinda low to me and I am guessing that there is a probably a newer hot fix available.
My Infragistics Keys and Downloads - Download Anything and Everything You Own
I'm using version 7.1.20071.1045