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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CellRenderer.Dispose() in a custom cell type never called when deleting a row

Thread ID:

Created:

Updated:

Platform:

Replies:

32414 Jul 29,2005 07:40 AM UTC Jul 29,2005 08:22 AM UTC Windows Forms 2
loading
Tags: GridControl
Michael Mann
Asked On July 29, 2005 07:40 AM UTC

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

Administrator [Syncfusion]
Replied On 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.

Michael Mann
Replied On July 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

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

;