The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
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 );
ADAdministrator Syncfusion Team 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;
ARarvindAugust 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 );
ADAdministrator Syncfusion Team 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.