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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Problem in deleting the a row

Thread ID:

Created:

Updated:

Platform:

Replies:

17476 Aug 10,2004 04:59 AM UTC Aug 10,2004 07:55 AM UTC WinForms 3
loading
Tags: GridControl
arvind
Asked On August 10, 2004 04:59 AM UTC

Hai, I am using GridDataBoundGrid and a contextMenu is associated with it.The grid contains multiple columns .I type in some data in first Column and move to the next column of the same row.When I come back to the first Column and click delete ,Stack overflow Exception is thrown ,The code I am using is this.datagrid.Binder.RemoveRecords(e.From-1, e.To-1 );

Administrator [Syncfusion]
Replied On August 10, 2004 05:47 AM UTC

Where are you trying to call this code? You should not be doing it from within a RowDeleting or RowsDeleted event as this will trigger recursive calls. If you need to do it there, set up a class member that flags whether you are in a delete or not. At the start of the event handler, test this member and return if you are in a delete. If not, set the member to true and perform your delete, and then set this member back to false. This should avoid the recursive calls. Also, before you delete rows, make sure there is not an open edit going on in the grid. Maybe call: if(this.inDelete) return; this.inDelete = true; grid.CurrentCell.EndEdit(); grid.Binder.EndEdit(); grid.Binder.RemoveRecords.... this.inDelete = false;

arvind
Replied On August 10, 2004 07:47 AM UTC

I am using this piece of code in the Row_Deleted event . >Hai, >I am using GridDataBoundGrid and a contextMenu is associated with it.The grid contains multiple columns .I type in some data in first Column and move to the next column of the same row.When I come back to the first Column and click delete ,Stack overflow Exception is thrown ,The code I am using is > >this.datagrid.Binder.RemoveRecords(e.From-1, e.To-1 );

Administrator [Syncfusion]
Replied On August 10, 2004 07:55 AM UTC

You will have to add the flag as suggested above to avoid the recursive call then. Calling RemoveRecords triggers the RowDeleted event, where you call RemoveRecords which triggers the RowsDeleted event where you call RemoveRecords, and so on forever..... and this is why you are seeing the stack overflow.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;