Hi,
I am using ExpandMode.WebService option to load child nodes dynamically.
Following is the code:
UI -
<telerik:RadTreeView ID="uxRadTreeView"
Runat="server"
<Nodes>
<telerik:RadTreeNode runat="server"
ExpandMode="WebService"
Text="Category1" Value="Category1">
</telerik:RadTreeNode>
</Nodes>
<webservicesettings method="GetChildNodes"
path="SampleService.asmx" />
</telerik:RadTreeView>
WebService Method -
public static RadTreeNodeData[] GetChildNodes(RadTreeNodeData node, object context)
{
List<RadTreeNodeData> result = new List<RadTreeNodeData>();
// add data for child nodes
for (int i = 0; i < 5; i++)
{
RadTreeNodeData nodeData = new RadTreeNodeData();
nodeData.Text = "child" + node.Value.ToString() + i;
nodeData.Value = "child" + node.Value.ToString() + i;
nodeData.Attributes.Add("onclick", "func();");
if (i == 0)
{
//temporarily make first node always expandable
nodeData.ExpandMode = TreeNodeExpandMode.WebService;
}
result.Add(nodeData);
}
return result.ToArray();
}
I am attaching onclick handler to each child node, please refer the green line above.
When i click on the node, onclick handler does not execute. Am i missing something?
I also tried iterating all the child node on onclientnodepopulated handler and attaching the onclick handler there.
still no luck.
I would really appreciate any kind of help.
Thanks
Sonal