Best of Datasource and BindTo?

2 posts, 1 answers
  1. Caleb Sandfort
    Caleb Sandfort avatar
    38 posts
    Member since:
    Mar 2008

    Posted 04 Jun 2014 Link to this post


    I am attempted to work with a treeview and it is not going very well.  I am using Datasource property to get the nodes of the treeview which works.  I want to be able to set the ImageUrl of the nodes.  This is something that I have been able to do in the past using BindTo and mapping the appropriate fields.

    Is there some way to use the Datasource and set up a property mapping?  Unless I'm missing something, it seems like you are pretty limited with what you can do as far as setting any node properties other than the text using the Datasource.

    Any help would be appreciated.
  2. Answer
    Alex Gyoshev
    Alex Gyoshev avatar
    2515 posts

    Posted 05 Jun 2014 Link to this post

    Hello Caleb,

    You can project your data via an anonymous type on the server -- so that the TreeView picks up the imageUrl field. An example of this can be seen in the remote data binding example in the demos (see the controller source).

    Alex Gyoshev

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top