开发者

RadTreeNode data set in code behind doesn't appear in WebService callback

开发者 https://www.devze.com 2023-03-23 06:38 出处:网络
I have a radtreeview that I am initially data binding in the my page code but any node expansion relies on a call to a SVC web service.

I have a radtreeview that I am initially data binding in the my page code but any node expansion relies on a call to a SVC web service. The problem is that while the event fires properly and runs the following method out of my webservice:

[OperationContract]
[WebMethod]
public RadTreeNodeData[] TreeViewNodeExpand(RadTreeNodeData ExpandedNode, 
                                                object context)    {
          // blah blah some code
}

The RadTreeNode ExpandedNone parameter is null. When I built the initial tree in my code behind, I set

List<RadTreeNode> collection 
= (data.Select(x => new RadTreeNode
{
    Category = category,
    ExpandMode = WebService,
    Value = x.Value.ToString(),
    Text = x.Text,
    DataItem = 555
})).ToList();

I explicitly set DataItem开发者_如何学Go to '555'. Am I missing something as to why RadTreeNodeData ExpandedNode is null when the webservice method fires?

My radtreeview markup is below:

<telerik:RadTreeView ID="treeView" CheckBoxes="true" PersistLoadOnDemandNodes="true"
    TriStateCheckBoxes="True" runat="server" CheckChildNodes="True" CausesValidation="false"
    EnableEmbeddedSkins="false" Skin="VBoD">
    <WebServiceSettings Path="~/WebServices/Retriever.svc" Method="TreeViewNodeExpand">
    </WebServiceSettings>
</telerik:RadTreeView>


I assume signature of service method is stronly fixed:

RadTreeNodeData[] WebServiceMethodName(RadTreeNodeData node, object context).

You should rename 'ExpandedNode' to 'node'.

0

精彩评论

暂无评论...
验证码 换一张
取 消