This is a migrated thread and some comments may be shown as answers.

Attribute of RadTreeView

4 Answers 59 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Barry
Top achievements
Rank 1
Barry asked on 13 Nov 2008, 02:10 AM
Each one of my nodes has an attribute of "NodeType". That all works fine. On the server side, OnNodeClick event, I need to know the value of the "Node Type" attribute of the previously selected node. So I added an attribute to the RadTreeControl and I update that attribute each time the node type changes. It doesn't work. The attribute value of the RadTreeControl is not persistant. The next time a node is clicked the server thinks the attribute value is back to its initial value.

I can see in the content being generated that the attribute is being passed in the RadTreeView object.
On the post back, __CALLBACKPARAM  does not include the attribute.

Can a RadTreeView control have an attribute value? Looks like it can.
What would I have to do to includ it in the __CALLBACKPARAM.

Is there some other way to keep track of the last node?

Thanks!

Bary




4 Answers, 1 is accepted

Sort by
0
Atanas Korchev
Telerik team
answered on 13 Nov 2008, 03:02 PM
Hello Barry,

You should be able to access any attribute of any node in the NodeClick event except when you are using load on demand and the PersistLoadOnDemandNodes property is set to false. Please give us more details about your scenario.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Atanas Korchev
Telerik team
answered on 13 Nov 2008, 03:02 PM
Hello Barry,

You should be able to access any attribute of any node in the NodeClick event except when you are using load on demand and the PersistLoadOnDemandNodes property is set to false. Please give us more details about your scenario.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Barry
Top achievements
Rank 1
answered on 13 Nov 2008, 03:52 PM
Albert,

My question is regarding RadTreeView.Attributes[] NOT RadTreeNode.Attributes[]. (RadTreeNodes work fine.)

I can do this:
tv_Main.Attributes.Add("Location_id","999");
or
tv_Main.Attributes["Location_id"] = 999.

In the debugger the attribute is added or modified as expected.

When the content is generated I can see the attribute being sent to the client. (I use HtttpFox in Firefox)

But on the subsequent postback the attribute is missing.

Thanks!

Barry

0
Atanas Korchev
Telerik team
answered on 13 Nov 2008, 04:24 PM
Hi Barry,

I couldn't reproduce this behavior in the current official version of RadTreeView. Find attached a sample project.

Regards,
Albert
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
TreeView
Asked by
Barry
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Barry
Top achievements
Rank 1
Share this question
or