Post Custom Properties

4 posts, 0 answers
  1. Vme
    Vme avatar
    18 posts
    Member since:
    Mar 2008

    Posted 13 Jan 2011 Link to this post

    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}
  2. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 18 Jan 2011 Link to this post

    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.
  3. Kyle
    Kyle avatar
    2 posts
    Member since:
    Mar 2008

    Posted 18 Jan 2011 Link to this post

    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.
  4. Nikolay Tsenkov
    Admin
    Nikolay Tsenkov avatar
    734 posts

    Posted 21 Jan 2011 Link to this post

    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.
Back to Top