I have a tree view:
<
telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="true"
CheckChildNodes="true" TriStateCheckBoxes="true" Skin="Outlook" ShowLineImages="false"
Style="margin-bottom: 10px">
</telerik:RadTreeView>
And I set the following properties to support load on demand:
radTreeView.WebServiceSettings.Path =
"~/zz_Portal/KdsDimensionLoader.aspx";
radTreeView.WebServiceSettings.Method =
"GetKdsDimElements";
node.ExpandMode =
TreeNodeExpandMode.WebService;
When I check a checkbox and then expand the node for the first time the parent will loose the checked status and the children are unchecked.
Not the expected behaviour.
In the web method it WOULB be very easy to implement the expected behaviour if we could use a proper RadTreeNode object.
But in the samples RadTreeNodeData is used and this object has not the Checked property.
So, how can I use Web Methods for on demand loading and keeping the checked status of the parent and have all children checked as well after adding them to the parent?
Thanks for any reply.
[
WebMethod]
public static RadTreeNodeData[] GetKdsDimElements(RadTreeNodeData node)
{
List<RadTreeNodeData> result = new List<RadTreeNodeData>();
DataRow kdsDimSlicer = MDXSlicers.FindSlicerById("11");
MetaData metaData1 = (MetaData)HttpContext.Current.Session[SessionVariables.MetaData.ToString()];
if (metaData1 != null)
{
string dimName = (string)kdsDimSlicer[MDXSlicers.DIMENSION];
string hierarchyName = (string)kdsDimSlicer[MDXSlicers.HIERARCHY];
DataTable table = metaData1.GetMembers(dimName, hierarchyName);
DataRow[] rows = table.Select("ParentUniqueName = '" + node.Value.Replace("'", "''") + "'");
foreach (DataRow row in rows)
{
RadTreeNodeData childNode = new RadTreeNodeData();
childNode.Text = row[
"Name"].ToString();
childNode.Value = row[
"UniqueName"].ToString();
DataRow[] checkChilds = table.Select("ParentUniqueName = '" + childNode.Value.Replace("'", "''") + "'");
if (checkChilds.Length > 0)
{
childNode.ExpandMode =
TreeNodeExpandMode.WebService;
}
result.Add(childNode);
}
}
return result.ToArray();
}