//To add the Parent node
for (i = 0; i < TotalNodeCount; i++)
{
TreeNode = new TreeNodeAdv();
TreeNode.Text = "node" + nodenumber.ToString();
nodenumber++;
this.treeViewAdv1.Nodes.Add(TreeNode);
}
//To Add child node
foreach (TreeNodeAdv node in this.treeViewAdv1.Nodes)
{
TreeNode = new TreeNodeAdv();
TreeNode.Text = "node" + nodenumber.ToString();
nodenumber++;
node.Nodes.Add(TreeNode);
}
//To add the GridGrouping Control as custom control.
foreach (TreeNodeAdv node in Collect(this.treeViewAdv1.Nodes))
{
GridGroup = new GridGroupingControl();
GridGroup.GridVisualStyles = GridVisualStyles.Metro;
GridGroup.TopLevelGroupOptions.ShowCaption = false;
if (node.CustomControl == null)
{
node.CustomControl = GridGroup;
GridGroup.DataSource = dt;
node.CustomControl.Width = 300;
node.Height = 40;
}
}
|