Node customcontrol issue

Hi

Using version 6.1.0.34 of Essential Studio in a c# application.
I'm using custom controls in every node of a treeview.
To save resources, in some cases I need to deattach a customcontrol from a node.

The code myNode.customcontrol = null succesfully deattaches the control, but it does not free up the user object count in the task manager. To achieve that, I have to dispose the custom control, what makes me reinstantiate it when I want to attach it again to the node.

Note that If I instantiate a customcontrol, no user object are consumed, until I attach it to a treeview node.

Is there a way to deattach a customcontrol from a node and free up its user object without disposing it?

Thanks


1 Reply

HK Hemaladha K Syncfusion Team October 30, 2008 01:28 PM UTC


Hi Ariel,

Thank you for your interest in Syncfusion Products.

If your intention to deattach a customcontrol from a node and free up its user object without disposing it, you can use GC.Collect() method after deattach the customcontrol using myNode.customcontrol=null. Please refer to the code snippets that illustrates this.

[C#]


for (int i = 0; i < treeViewAdv1.Nodes.Count; i++)
{
this.treeViewAdv1.Nodes[i].CustomControl = null;
GC.Collect();
}

Please refer to the below simple sample and let me know if helps you.

http://websamples.syncfusion.com/samples/Tools.Windows/I50312/Tools_WF_treeview_customControl.zip

If I have misunderstood your requirement, could you please modify the above sample and send us, so that I could work out in depth and provide you a better solution at the earliest?

Please let me know if any concerns.

Regards,
Hema




Loader.
Up arrow icon