We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

DeleteAtRowIndex

I have the following data in a grid (with 1 child GridHierarchyLevel) : Parent 1 Child 1 Parent 2 Child 1 "Append Row" 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?

2 Replies

AD Administrator 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. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=15342


LS Lori S. Pearsall June 16, 2004 03:23 PM

That works perfectly!

Loader.
Live Chat Icon For mobile
Up arrow icon