You may need to recreate the data set you have gained from joining the tables:
: UserID, UserName, RoleID; and
: RoleID, RoleName;
A possible approach could be, to create a data set that will have the following structure (the result of the execution of the queries given bellow):
"Select ParentID = null, ID = RoleID, Name = RoleName, Description = RoleName from Roles"
+ "union all" +
"Select ParentID = RoleID, ID = UserId, Name = UserName, Description = null from Users"
So the structure of the result set will be:
ParentID, ID, Name, Description
*Please note that in this case the description of the roles is set to its role name,and the users don't have description i.e
ParentID ID Name Description
null 1 Managers Manager
null 2 Programmer Programmer
1 3 John null
2 3 Steve null
Now you can set the properties of the radTreeView to the following values:
DataTextField = "Name";
DataValueField = "Description";
DataFieldID = "ID";
DataFieldParentID = "ParentID";
Hope this helps.
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward!
We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>