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

Post Custom Properties

3 Answers 34 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Vme
Top achievements
Rank 1
Vme asked on 13 Jan 2011, 05:04 PM
http://www.telerik.com/help/aspnet-ajax/setting-additional-properties-to-the-node-in-the-web-service.html

According to the above link you can use a CustomRadTreeNodeDate class to send data to the client.  This all works great.  I'm looking for a way to post that information back to the webservice.  I can store the information in a node attribute, but I was wondering if there was a way to just "bind" it directly to the CustomRadTreeNodeData.  For example

public CustomRadTreeNodeData[] GetNodesWithToolTips(CustomRadTreeNodeData node, IDictionary context) {<br>}


When I POST information back to the webservice is there a way so I can access node.Tooltip?  I see ToolTip get sent to the client in the json response, but it never gets posted back??

POST:
{"node":{"Text":"node 1","Value":null,"ExpandMode":3,"NavigateUrl":null,"PostBack":true,"DisabledCssClass":null,"SelectedCssClass":null,"HoveredCssClass":null,"ImageUrl":null,"HoveredImageUrl":null,"DisabledImageUrl":null,"ExpandedImageUrl":null,"ContextMenuID":"","context":{}}
RESPONSE:
{"__type":"radtreeLoadOnDemand.CustomRadTreeNodeData","Text":"node 1","Value":"","ExpandMode":3,"NavigateUrl":"","PostBack":true,"DisabledCssClass":"","SelectedCssClass":"","HoveredCssClass":"","ImageUrl":"","HoveredImageUrl":null,"DisabledImageUrl":"","ExpandedImageUrl":"","ContextMenuID":null,"ToolTip":"My ToolTip","CssClass":"","ContentCssClass":null,"Enabled":true}

3 Answers, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 18 Jan 2011, 01:43 PM
Hello Kyle,

You can use the attributes collection of the RadTreeNode in order to transfer something back to the server.
Please, try this approach and let me know the results.


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Kyle
Top achievements
Rank 1
answered on 18 Jan 2011, 03:58 PM
Nikolay,

Like I mentioned in the original post I know you can accomplish this with node attributes.  I was looking for a different way.  Its not that big of  a deal to use node attributes, I was just looking for a more strongly typed way if possible.  I will continue to use the node attributes unless you have another suggestion.  Thanks for you help.
0
Nikolay Tsenkov
Telerik team
answered on 21 Jan 2011, 10:44 AM
Hi Vme,

There isn't a better (as type-safety) way to send contextual information to the service.


Regards,
Nikolay Tsenkov
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Tags
TreeView
Asked by
Vme
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Kyle
Top achievements
Rank 1
Share this question
or