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

Release memory

Thread ID:

Created:

Updated:

Platform:

Replies:

68897 Oct 4,2007 05:10 PM UTC Oct 11,2007 03:11 AM UTC WinForms 1
loading
Tags: GridControl
Lan Mo
Asked On October 4, 2007 05:10 PM UTC

Hi,
VS2003, 4.4.0.51

In your sample,
C:\Program Files\Syncfusion\Essential Studio\4.4.0.51\Windows\Grid.Grouping.Windows\Samples\PerformanceSamples\GroupingPerf\CS\GroupingPerf_2003.sln

The code releases memory used by the grid by dispose it, and recreate a new grid when next time reload.
void ResetGroupingGrid()
{
if (this.grid != null)
{
this.gridPanel.Controls.Remove(this.grid);
this.grid.Dispose();
this.grid = null;
this.table.Dispose();
this.table = null;
this.LogMemoryUsage1();
}
}



My questions is:
Is there any way to release the memory used by the grid without dispose and set it to null?
Because I have a form painted GGC at designed time. There are several buttons to reload the grid by different table data or by same table with different where condition.

Thanks,

Lan



Saravanan A [Syncfusion]
Replied On October 11, 2007 03:11 AM UTC

Hi Lan,

You can try resetting the datasource of the grid and then reinitialize it instead of disposing the grid.


void ResetGroupingGrid()
{
if (this.grid != null)
{
//this.gridPanel.Controls.Remove(this.grid);
//this.grid.Dispose();
//this.grid = null;
if(this.grid.DataSource != null)
{
this.grid.DataSource = null;
this.grid.DataMember = "";
this.grid.Engine.Reset();
this.grid.Engine.ResetTableDescriptor();
this.grid.Engine.ResetTable();
}
this.table.Dispose();
this.table = null;
this.LogMemoryUsage();
}
}


Regards,
Saravanan

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

;