I am using the radTreeViewControl I added the items with the property ItemsSource, according the an example I saw in the forums.
I want to bring data to my application according the checked items.
I'm not succeeding to know which child node is checked.
While debuging, the debuger shows that the parent is checked, and doesn't show the child,(In the UI the child node is checked).
So how could I know which child is checked?
I create the class
public class DataItem
{
public MyPath Key { get; set; }
public string Name { get; set; }
public List<DataItem> Items { get; set; }
public DataItem()
{
this.Items = new List<DataItem>();
}
}
added the items
void LoadRootNodes(MyKey[] keys, MyPath path)
{
foreach (MyKey key in keys)
{
MyPath tempPath = path.GetChildLevel(key);
foreach (W6TreeNodeConfigSection node in settings.TreeNodes)
{
if (node.W6Key == key.Key.ToString())
{
if (node.View.Equals(true) && settings.ViewAll.Equals(true))
{
Items.Add(
new DataItem() { Key = key, Name = key.Name });
if (m_navigationTree.GetChildrenPaths(path).Length > 0)
{
LoadChildren(tempPath, Items[Items.Count - 1]);
}
break;
}
}
}
}
}
private void LoadChildren(MyPath path, DataItem item)
{
MyKey[] keys;
keys = m_navigationTree.GetChildrenKeys(path);
Array.Sort(keys);
foreach (MyKeykey in keys)
{
item.Items.Add(
new DataItem() { Key = key, Name = key.Name });
if (m_navigationTree.GetChildrenPaths(path).Length > 0)
{
MyPath tempPath = path.GetChildLevel(key);
LoadChildren(tempPath, items[Items.Count - 1]);
}
}
}
List<DataItem> items;
public List<DataItem> Items
{
get { return items; }
set { items = value; }
}
telerikTreeView.IsTriStateMode =
true;
telerikTreeView.SelectionMode =
SelectionMode.Multiple;
telerikTreeView.ItemsSource = Items;
telerikTreeView.ItemsOptionListType =
OptionListType.CheckList;
telerikTreeView.IsOptionElementsEnabled =
true;
Thanks
Toiby