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.
Hi,
i have the following problem: When I delete a row in my grid, not all resources of my custom cell type were cleaned up - particularly objects within my renderer.
I thought I could use the dispose method, but that one is only called when the grid disposes itself. I tried to find a way to call the Dispose method myself but I don''t get into my renderer, I am only able to call the Dispose method of the cell model.
Is there a way that the dispose method of the renderer is implicitly called when a row is deleted?
Thanks in advance
Michael
ADAdministrator Syncfusion Team July 29, 2005 08:09 AM UTC
This behavior is by design. You add the cellmodel to the grid (grid.CellModels actually). So, it is the grid that owns teh cellmodel (and the corresponding cellrenderer). You could choose to use the celltype in more than one row, so just removing a row does not tell the grid to get rid of teh custom cell type.
One thing you could do is to move your disposable resources from the renderer to the cellmodel class. You could make them internal, and access them in your renderer from this.Model. Then you could handle the cellModel.Dispose to dispose them. You should remove the cellmodel from grid.CellModels before you dispose it after deleting your row.
MMMichael MannJuly 29, 2005 08:22 AM UTC
Hi,
that does make sense. Thinking about your answer I have to admit, that my approach is getting wrong. I only want to get sure, that resources of my cell type are released when a row with that cell type is deleted.
Thanks for your fast reply
Michael