Hi ! I hope this post will have its place here...
I realised a tree view in asp.net, and now I need to do the same for a winform... the matter is that there aren't the same properties.
For example I am using these methods in the asp version :
But for winform version there is no method "GetAllNodes()" for RadTreeView, and I have the same problem with "IsAncestorOf".
Could you help me and explain me which property/metho I can use without changing all my code ?
Thanks a lot !
Jean
I realised a tree view in asp.net, and now I need to do the same for a winform... the matter is that there aren't the same properties.
For example I am using these methods in the asp version :
private void Filter() |
{ |
try |
{ |
LoadAllNodes(); |
if (accountTextBox.Text.TrimEnd().Equals("*") || string.IsNullOrEmpty(accountTextBox.Text.TrimEnd())) |
return; |
//Get all nodes matching the filter |
List<RadTreeNode> matchingNodes = new List<RadTreeNode>(); |
IList<RadTreeNode> nodesToFilter = ((List<RadTreeNode>)radTreeView.GetAllNodes()).FindAll(delegate(RadTreeNode rdTNode) { return rdTNode.Tag.Equals("Account"); }); |
for (int i = 0; i < nodesToFilter.Count; i++) |
{ |
if (nodesToFilter[i].Text.StartsWith(accountTextBox.Text.TrimEnd(), StringComparison.OrdinalIgnoreCase)) |
matchingNodes.Add(nodesToFilter[i]); |
} |
IList<RadTreeNode> allNodes = radTreeView.GetAllNodes(); |
for (int i = 0; i < allNodes.Count; i++) |
{ |
if (IsToFilter(allNodes[i], matchingNodes)) |
allNodes[i].Remove(); |
} |
} |
catch (Exception ex) |
{ |
throw ex; |
} |
} |
private bool IsToFilter(RadTreeNode radTreeNode, List<RadTreeNode> matchingNodes) |
{ |
if (radTreeNode.Text.StartsWith(accountTextBox.Text.TrimEnd(), StringComparison.OrdinalIgnoreCase)) |
return false; |
foreach (RadTreeNode item in matchingNodes) |
{ |
if (radTreeNode.IsAncestorOf(item)) |
return false; |
} |
return true; |
} |
But for winform version there is no method "GetAllNodes()" for RadTreeView, and I have the same problem with "IsAncestorOf".
Could you help me and explain me which property/metho I can use without changing all my code ?
Thanks a lot !
Jean