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

Deleting rows from hierarchical GDBG

Hi - thanks for the assistance so far. We've got a GDBG which shows a hierarchical dataset, similar to the attached project. However, we are running into some strange behavior when the user attempts to delete a row. Sometimes when leaf nodes are deleted the whole branch goes with it. The tree structure seems to redraw strangely too.

I'm not sure if this is an open issue (we're using 4.4.0.54) or if perhaps we need to do something differently - I couldn't find anything in the knowledge base but perhaps I missed something. Thanks for any info !

-Rob


GDBGTreeLinesCustom.zip

3 Replies

HA haneefm Syncfusion Team April 23, 2007 09:32 PM UTC

Hi Rob,

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

Best regards,
Haneef


RY Rob Yang April 24, 2007 12:17 AM UTC

Hi Haneef - thanks for the info. I guess I should clarify : the question I had was in regards to the user selecting the row with the mouse and pressing the Delete key. The grid behaves strangely in that scenario.

Should we add an event handler of some kind to fix this, and if so what should it do ?

-Rob

>Hi Rob,

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

Best regards,
Haneef


HA haneefm Syncfusion Team April 24, 2007 11:38 PM UTC

Hi Rob,

Here is a forum thread that discuss with row deleting event.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=54380

Best regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon