How is the tree being generated?
Without any source it is very difficult to assist.
Main Topics
Browse All TopicsGreetings,
The picture below demonstrates the goal of creating a subcategory called 'Notices' on the Telerik RadTreeView control.
My question: What do I need to do so that I have a new subcategory called 'Notices' for every project under 'Projects' ?
I have tried to follow the code to determine how subcategories are created for each project but I'm having some difficulty. I need help determining what code exactly populates this tree and then I need help adding an additional object.
Thanks!!
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Ok, thanks for that last post......
The page which contains this code is a master page and starts like this:
Partial Public Class BF_MasterPage
Inherits System.Web.UI.MasterPage
....
Public Structure EntityNodeData
...
I stuck the structure code just below this. Sound right?
Also, I have errors where ever the assignment to the value occurs. For instance:
With xNode
.Attributes.Add("Entity_ID
.Attributes.Add("Tag", "eClass")
' Use data structure so that both ID and Type can be accessed at a later stage.
.Value = New EntityNodeData(dr.Item("En
.Text = dr.Item("EntityName").ToSt
.ImageUrl = Navigator_GetImageURL(dr.I
End With
The error:
Value of type 'BF_MasterPage.EntityNodeD
Your thoughts?
> I stuck the structure code just below this. Sound right?
Yep, that should be fine! Place the replacement class in the same place.
> Also, I have errors where ever the assignment to the value occurs. For instance:
Ah, I was afraid that might happen, I was hoping that "Value" was of type "Object" or "Variant". Okay, this shouldn't be a problem.
In that case, you will need to subclass the "RadTreeNode" class so that it does support what you need. This is probably a good idea anyhow, you will be able to store any information you want to with each node:
>> some subtle changes have been made, like on line 57, for example:
Ok, on that particular line I'm getting the following errors:
Argument not specified for parameter 'id' of 'Public Sub New(id As String, type As String)'
Argument not specified for parameter 'type' of 'Public Sub New(id As String, type As String)'
After that I have the following two errors for the associated lines:
--------------------------
ERROR ON *** xNode ***
KNavigator_LoadNode(oDataS
Option Strict On disallows narrowing from type 'Telerik.Web.UI.RadTreeNod
--------------------------
ERROR ON *** NodeParent ***
Dim entityNode As EntityTreeNode = NodeParent
Option Strict On disallows implicit conversions from 'Telerik.Web.UI.RadTreeNod
--------------------------
> Ok, on that particular line I'm getting the following errors:
Please verify that you have written the following:
Public Sub New(ByVal id As String, ByVal type As String)
NOT the following:
Public Sub New(id As String, type As String)
> After that I have the following two errors for the associated lines:
Can you please post your full page code so that I can investigate?
>> Can you please post your full page code so that I can investigate?
I would love to but there are 1,692 lines on this particular page if that's indeed what you are talking about. However, I'm a little leary of the whole trade secret thing by dumping so much.
Don't you agree that although 'Inherits RadTreeNode' within the class would seem to address the original issue of type:
Dim xNode As New Telerik.Web.UI.RadTreeNode
... the ,Public Sub New()' just doesn't agree by virtue of these two parameters
(ByVal id As String, ByVal type As String)
What am I missing?
Here's the code as it is in my project:
> would love to but there are 1,692 lines on this particular page if that's indeed what you are
> talking about. However, I'm a little leary of the whole trade secret thing by dumping so much.
Sure, 1,692 would be excessive, and you should never release anything that you want to keep secret.
> What am I missing?
Actually it is something that I missed, simply change the class that you added to the following. Apologies for this error on my part.
Ok, the added Sub New() got rid of the first error but still have these two:
--------------------------
ERROR ON *** xNode ***
KNavigator_LoadNode(oDataS
Option Strict On disallows narrowing from type 'Telerik.Web.UI.RadTreeNod
--------------------------
ERROR ON *** NodeParent ***
Dim entityNode As EntityTreeNode = NodeParent
Option Strict On disallows implicit conversions from 'Telerik.Web.UI.RadTreeNod
--------------------------
Can you tell me why the compiler sees this as a conversion rather than a modification of attributes? Isn't that what you are trying to do?
This took care of the second error. Only this one now:
--------------------------
ERROR ON *** xNode ***
KNavigator_LoadNode(oDataS
Option Strict On disallows narrowing from type 'Telerik.Web.UI.RadTreeNod
--------------------------
I guess the recursive aspect of this entire method doesn't like going back and forth between 'EntityTreeNode' and 'Telerik.Web.UI.RadTreeNod
> Maybe this is a case of a lazy control - just doesn't want to do the work - yes/no?
rofl - funny!
> I guess the recursive aspect of this entire method doesn't like going back and forth between 'EntityTreeNode' and 'Telerik.Web.UI.RadTreeNod
Try using the following line instead, perhaps a TryCast will work here too.
KNavigator_LoadNode(oDataS
Getting closer all the time.
I ran the code and it worked from the standpoint there were no runtime errors. However, it only shows the icons in the far left picture below. Thus, no subfolders are being added.
The picture on the far right shows what it normally looks like. The fully expanded view is at the top of this question.
Can you tell me if you agree with what I see going on here:
Steps
1) Create table for incoming dataset
2) Sort the table and store it in foundRows() table
3) For each row in the sorted table create a node
4) For each node set the attributes
5) Add the new node to the parent node
6) Get new dataset based upon whether the database shows
subfolders/objects for the current Entity_ID
7) If so, add the result of the dataset to XNode
8) If the current Entity_ID is a of type 'Notice Templates'
add an icon to it
Did I miss anything? I'm trying to see why the subfolders weren't added but I don't see it. I'm also wondering why the following subnodes/folders aren't added during a normal load but this time they were:
My Projects
My Contacts
Administration
I take it there is a filter in the event there is no data to load?
The only thing that I can think is that perhaps the RadTree compares each tree node instance with something internal for some reason.
Backup what you have and change the following part. If all of the project tree nodes appear again, then this is the reason why, and we will need to find another way to associate additional information with each node.
Simply change xNode back to "RadTreeNode" and remove the two indicated lines from the With xNode block. This will not fix your problem, but it will indicate whether or not this approach is going to work.
I wish I could say that worked but it doesn't. Same results as the last picture I posted.
For what ever it's worth, I included some write statements so that I could get a better idea of what's going on. Below you can see the results given the original code and the revised. Everything in the database is sample data in case you are wondering.
I inserted three WriteToFile() statements.
1) First statement within - kNavigatorMain_Load( ... )
2) First statement within - KNavigator_LoadNode( ... ) As Boolean
3) After xNode attributes are assigned ( seen below )
All of this may be obvious to you so forgive the extra information if it is. Otherwise I see that for 'For Each dr As DataRow In foundRows' the revised code somehow stores two DataRows where the original does not.
Original Code
--------------------------
kNavigatorMain_Load( ByVal LocationID As Integer )
KNavigator_LoadNode( ByRef oDataSource As DataSet, ByRef NodeParent As Telerik.Web.UI.RadTreeNode
Value: 317
Text: ABC EAST
KNavigator_LoadNode( ByRef oDataSource As DataSet, ByRef NodeParent As Telerik.Web.UI.RadTreeNode
Value: 1166
Text: asdfsdfewef
KNavigator_LoadNode( ByRef oDataSource As DataSet, ByRef NodeParent As Telerik.Web.UI.RadTreeNode
Value: 1168
Text: New Office
KNavigator_LoadNode( ByRef oDataSource As DataSet, ByRef NodeParent As Telerik.Web.UI.RadTreeNode
Value: 1184
Text: RyoungEun House
KNavigator_LoadNode( ByRef oDataSource As DataSet, ByRef NodeParent As Telerik.Web.UI.RadTreeNode
...
...
...
125 nodes total
--------------------------
Revised Code Results
--------------------------
kNavigatorMain_Load( ByVal LocationID As Integer )
KNavigator_LoadNode( ByRef oDataSource As DataSet, ByRef NodeParent As Telerik.Web.UI.RadTreeNode
Value: 317
Text: ABC EAST
KNavigator_LoadNode( ByRef oDataSource As DataSet, ByRef NodeParent As Telerik.Web.UI.RadTreeNode
Value: 1166
Text: asdfsdfewef
Value: 5
Text: ABC Builders
kNavigatorMain_Load( ByVal LocationID As Integer )
KNavigator_LoadNode( ByRef oDataSource As DataSet, ByRef NodeParent As Telerik.Web.UI.RadTreeNode
Value: 317
Text: ABC EAST
KNavigator_LoadNode( ByRef oDataSource As DataSet, ByRef NodeParent As Telerik.Web.UI.RadTreeNode
Value: 1166
Text: asdfsdfewef
Value: 5
Text: ABC Builders
NO MORE DATA / NODES
--------------------------
I guess another point worth mentioning is that although the revised code appears to create six nodes ( seen with WriteToFile() ), these nodes never make it to the web page http://#ID:24755820
Business Accounts
Answer for Membership
by: crittle1Posted on 2009-06-30 at 09:16:52ID: 24746825
I looked, I'm not able to help :( I'm so sorry