Different binding element on XML Datasource

4 posts, 0 answers
  1. jialiang_liu
    jialiang_liu avatar
    28 posts
    Member since:
    Jul 2006

    Posted 06 Nov 2008 Link to this post

    Is it possible that I can bind different attribute depends on what the node is to TreeView?

    like if I have a XML  that has
    <Node1 text="abc" value="a">
        <subNode1 gest="xxxxx"></subnode1>
    </Node1>

    I can bind to text on Node1 and bind to gest on SubNode1.
  2. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 07 Nov 2008 Link to this post

    Hello jialiang_liu,

    You can try adding a RadTreeNodeBinding for the specific node level:

    <telerik:RadTreeView>
        <DataBindings>
            <telerik:RadTreeNodeBinding Level="1" TextField="text" />
            <telerik:RadTreeNodeBinding Level="1" TextField="gest" />
        </DataBindings>
    </telerik:RadTreeView>

    Alternatively you can hook up to the NodeDataBound event and perform the mapping from code.

    Sincerely yours,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. jialiang_liu
    jialiang_liu avatar
    28 posts
    Member since:
    Jul 2006

    Posted 07 Nov 2008 Link to this post

    Level is not a recognized word. Do you mean Depth?
  4. Atanas Korchev
    Admin
    Atanas Korchev avatar
    8462 posts

    Posted 10 Nov 2008 Link to this post

    Hi jialiang_liu,

    Yes, I meant the Depth property. Please excuse me for misleading you.

    Regards,
    Albert
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top