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

[Solved] specify max number of children under a node

1 Answer 88 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
chandana
Top achievements
Rank 1
chandana asked on 28 Apr 2009, 08:36 PM
Hello, 

I am binding a treeview to an xml which looks something like this

<Tree id="treeroot">
  <Node id="1" Expanded="true" Text="Selected Fields" Checkable="false">
    <Node id="Addresses" Text="Addresses" Expanded="true" Checkable="false" allowMultipleChildren="5">
      <Node id="FieldedAddress" Text="Fielded Address" ToolTip="fielded address" Checkable="true" AllowDrop="false">
        <Node id="FieldedAddress_HouseNumber" Text="House Number" Checkable="false" AllowDrop="true"/>
        <Node id="FieldedAddress_FractionalHouseNumber" Text="Fractional House Number" Checkable="false" AllowDrop="true"/>
      </Node>
   </Node>
 </Node>
</Tree>

Is there a way to specify max number of children that can be dropped for certain nodes?
if i have an attribute called "allowmultiplechildren" whose value is 5 in the xml, is there a way that i could use that value in the onNodeDropping event?? I am trying to convert an existing xml into the format accepted by tree view. wondering if i could keep some of the xml attributes intact and use them somehow on the dropping event??

Thank you,
Chandana

1 Answer, 1 is accepted

Sort by
0
Accepted
Atanas Korchev
Telerik team
answered on 29 Apr 2009, 12:43 PM
Hi chandana,

Do you use the LoadContentFile method ? If yest any XML attributes that are not valid RadTreeNode properties will be mapped as custom attributes. You can then access them on the client-side:

node.get_attributes().getAttribute("AllowMultipleChildren");

Regards,
Albert
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
TreeView
Asked by
chandana
Top achievements
Rank 1
Answers by
Atanas Korchev
Telerik team
Share this question
or