Best of Datasource and BindTo?

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

    Posted 04 Jun 2014 Link to this post

    Hi

    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
    Admin
    Alex Gyoshev avatar
    2500 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).

    Regards,
    Alex Gyoshev
    Telerik
     

    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.

     
  3. UI for ASP.NET MVC is VS 2017 Ready
Back to Top