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

custom attributes when using xml

2 Answers 105 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Neil
Top achievements
Rank 1
Neil asked on 18 Apr 2008, 07:11 AM
Hi,

It looks like the custom attributes don't get set any-more when using (for example):
treeView.LoadXmlString(newDoc.OuterXml)

a node from my XML string looks like:
<Node ImageUrl="~/images/TaskRes.gif" Text="the task" Value="{9400594D-10D0-426D-813E-84B9E3811587}" Category="rstrt" Expanded="true">

I want to be able to later access the attribute 'Category'.  This all last worked in the RadControls 2007 Q3 classic version, why not now?

thanks

ps. I've also tried using treeView.LoadXml(newDoc.OuterXml), same result!

2 Answers, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 18 Apr 2008, 10:46 AM
Hi Neil,

Category is a property of the node object so you should access it that way. Custom attributes are created only for XML attributes which do not have corresponding RadNode properties.

I hope this helps,
Albert
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Feizal Amlani
Top achievements
Rank 1
answered on 15 Apr 2009, 09:47 PM
Hello,

I am loading a XML string into the TreeView like so...
<Tree><Node id="myuniqueid" anotherid="anotheruniqueid" EnableContextMenu='false' Text='MyText' Value='1' Checkable='false'></Node></Tree>

It seems that when I  bind the XML to the Tree like PHTreeView.LoadXml(sb.ToString) the "id" is not part of the attributes collection.  However, "anotherid" is added correctly.

I need to do this in the attributes collection as I am using the Tooltip control as well and need to set the Target property of the TooltipManager.  It uses the "id" attribute.

Thanks.

Tags
TreeView
Asked by
Neil
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Feizal Amlani
Top achievements
Rank 1
Share this question
or