specify max number of children under a node

2 posts, 1 answers
  1. chandana
    chandana avatar
    17 posts
    Member since:
    Mar 2007

    Posted 28 Apr 2009 Link to this post

    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

  2. Answer
    Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 29 Apr 2009 Link to this post

    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.
Back to Top