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

NodeTemplates and ExpandMode "Webservice"

3 Answers 50 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
JP
Top achievements
Rank 1
JP asked on 10 Nov 2011, 11:11 AM
Hi,

regarding this topic I just found 3 year old threads, so maybe this feature was implemented in the meantime:

I need to have nodes which have more than one icon: I need icons which do a postback the same way as the context menu items can do this. As far as I know I can achieve this by using NodeTemplates.

But I use ExpandMode="Webservice", and three years ago this wasn't possible.
Is it possible to achieve the things I want with the current version?

Regards,
JP

3 Answers, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 15 Nov 2011, 12:46 PM
Hello Jp,

Would you please let us know which is the forum post that you are having in mind so that I can review it and  provide you with the appropriate information about it.
 
Greetings,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
0
JP
Top achievements
Rank 1
answered on 15 Nov 2011, 01:54 PM
Hello,

This is one post about having more than one image per node and that you can use node templates for this:
http://www.telerik.com/community/forums/aspnet-ajax/treeview/changing-images-during-expanding-nodes-in-treeview.aspx#1372449


I found these two threads when searching for "nodetemplate webservice" because I want to populate the tree by using a webservice:
http://www.telerik.com/community/forums/aspnet-ajax/treeview/nodetemplate-and-expandmode-webservice.aspx 
http://www.telerik.com/community/forums/aspnet-ajax/treeview/can-you-use-expandmode-webservice-with-templates-that-use-databinding.aspx 

Regards,
JP
0
Plamen
Telerik team
answered on 18 Nov 2011, 11:14 AM
Hi Jp,

Unfortunately as it is mentioned in one of the forums that you listed,  node templates will not work with nodes added by Web Service.

The only work around that I could think of is to use the following code to add an image and use the NavigateUrl property to redirect to the page:

foreach (DataRow row in productCategories.Rows)
        {
            RadTreeNodeData itemData = new RadTreeNodeData();
            itemData.Text = "<img src='rainy.gif' />";
       itemData.ImageUrl = "rainy.gif";
       itemData.NavigateUrl = "http://www.telerik.com";
            itemData.Value = row["CategoryId"].ToString();


Hope this will be helpful.

All the best,
Plamen Zdravkov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Tags
TreeView
Asked by
JP
Top achievements
Rank 1
Answers by
Plamen
Telerik team
JP
Top achievements
Rank 1
Share this question
or