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. Image for the cookie policy date
close icon

Adding custom controls dynamically in treeviewadv

How do I add custom controls as child node in treeviewadv?
I tried the following code :

Syncfusion.Windows.Forms.Grid.GridControl gridControl1=new Syncfusion.Windows.Forms.Grid.GridControl();
gridControl1[2, 1].Text = "2007";
gridControl1[2, 2].Text = "107,449,525";
gridControl1[2, 3].Text = "1,972,550(sq km) 761,602(sq mi)";

TreeNodeAdv treeNodeAdv8 = new Syncfusion.Windows.Forms.Tools.TreeNodeAdv();
treeNodeAdv8.ChildStyle.EnsureDefaultOptionedChild = true;
treeNodeAdv8.CustomControl = gridControl1;
treeNodeAdv8.EnsureDefaultOptionedChild = true;
treeNodeAdv8.Height = 56;
treeNodeAdv8.Optioned = true;
treeViewAdv1.Nodes.Add(treeNodeAdv8);

I get the grid along with the text "TreeNodeAdv" on the side. How do I only get the grid and not the text?

1 Reply

PJ Poly J Syncfusion Team May 26, 2009 06:11 AM UTC

Hi,

Thanks for your interest in Syncfusion Products.
Set the text property of the treenodeAdv to an empty string for hide the text label in the tree node. Please use the below code snippet for set the text property of the treenode.


treeNodeAdv8.Text = "";


Let us know if you need further assistance with this.

Best Regards,
Poly

Loader.
Live Chat Icon For mobile
Up arrow icon