I have the following data in a grid (with 1 child GridHierarchyLevel) :
If the children are collapsed and I select Parent 2, I get a RowIndex of 2 from the selected range and pass it to DeleteAtRowIndex - this works.
If the children are expanded and I select Parent 2, I get a RowIndex of 3 from the selected range and pass it to DeleteAtRowIndex - this doesn''t work because it thinks I''m trying to delete the "append row".
What am I missing here? What conversion should I be performing on the row indices in the selection range to get an index that DeleteRowAtIndex wants?
ADAdministrator Syncfusion Team June 16, 2004 02:11 PM
In a Expand-type grid, you will not be able to use DeleteAtRowIndex to delete arbitrary rows.
It is easier to work directly with the CurrencyManager. From the grid row index, you can get the GridBoundRecordState of the row. From the recordstate, you can get the currencymanager and the position in the list. From there, you can use currencyManager.List.RemoveAt to remove the datarow. See this thread for some code snippets.