Hi,
I am simulating an Excel like control with the wingrid. It uses an UltraDataSource as data source.When user selects a range of cells, and presses DEL, I remove all the data in the selected cells.The code for this:
foreach (UltraGridCell cell in _grid.Selected.Cells){ cell.Value = DBNull.Value;}
This works fine, but it leaves the affected rows in edit mode.
See the pencil icons at the beginning of the rows.
I tried SuspendBindingNotifications before, did not help.Tried SuspendRowSynchronization before, did not help.Tried PerformAction(CommitRow) after, did not help.
How could I make the grid to "commit" these changed rows, or prevent this?
Thanks
How are you clearing out the cell values? Are you doing it yourself or are you using the grid's built-in AllowMultiCellOperation funtionality?
Either way, what you need to do is commit the changes to the data source after the operation completes. You do this by calling grid.UpdateData().
Hi Mike,
thank you, it works, nice!
For your quesiton "How are you clearing out the cell values?"I do the clear manually:foreach (UltraGridCell cell in _grid.Selected.Cells) cell.Value = DBNull.Value;