Hello All,
I'm working on an active directory project where the RadTreeView requires it's nodes to have images according to the nodes respective containers (I.E. User Accounts will have an user icon). I have posted some code relating to my issue. I hope someone here can shed some light on this and tell me what it is I'm doing wrong.
To be clear on this, the nodes show active directory binded data but not the images. Thank you in advance.
public void subEnumerateChildren(RadTreeNode oRootNode)
{
DirectoryEntry deParent = new DirectoryEntry("LDAP://RootDSE");
foreach (DirectoryEntry deChild in deParent.Children)
{
RadTreeNode oChildNode = oRootNode.Nodes.Add(deChild.Path);
switch (deChild.SchemaClassName)
{
case "computer":
oChildNode.ImageIndex = 6;
break;
case "user":
oChildNode.ImageIndex = 7;
break;
case "group":
oChildNode.ImageIndex = 8;
break;
case "organizationalUnit":
oChildNode.ImageIndex = 3;
break;
case "container":
oChildNode.ImageIndex = 1;
break;
case "publicFolder":
oChildNode.ImageIndex = 5;
break;
default:
oChildNode.ImageIndex = 1;
break;
}
oChildNode.Tag = deChild;
oChildNode.Text = deChild.Name.Substring(3).Replace("\\", "");
}
}