Hi,
I have a situation where I need to create a tree consisting of the following entities:
Organization Entity
---> Organization Account
--> Organization Account Record
Organization Entities can have sub-Organization entities, Accounts can have sub-Accounts and records can have sub-records.
As such I want to have different icons for the entity types, Different expand and click functionality based on the types and different context menu's for each type.
I have created custom "RadTreeNode" classes in the following way:
public class OrgNode: RadTreeNode
{
public OrgNode()
{
this.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
this.ImageUrl = "../Images/image01.png";
}
}
public class OrgAccountNode: RadTreeNode
{
public OrgAccountNode()
{
this.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
this.ImageUrl = "../Images/image02.png";
}
}
public class OrgAccountRecordNode: RadTreeNode
{
public OrgAccountRecordNode()
{
this.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
this.ImageUrl = "../Images/image03.png";
}
}
My problem exists when I use the "TreeView_NodeExpanded" method, because (as mentioned above) I want to do different things based on what type of node is expanded...
Using the following statements:
e.Node.GetType()
returns correctly for the top node (OrgNode - the only node on the page not created using the serversidecallback) but only returns "RadTreeNode" as the type for all other nodes which I have added using ServerSideCallback even though the nodes added are showing the correct images and text.
Has anyone got any thoughts on this?