Hi
I have a tree view list which connects to a datasource and saves which nodes have been checked into a grid. When I load the page again I want to be able to take what is in the grid and check the corresponding nodes again. This is the code I have wrote so far, when the page loads it reads the datatable and checks the parent and child nodes which match the data. However it is checking all of the child nodes even though not all of the nodes appear in the datatable, how can I check the parent node in an intermediate state?
DataTable Branches = new DataTable();
DataSourceSelectArguments args = new DataSourceSelectArguments();
DataView view = (DataView)sdsCampaignBranch.Select(args);
if (view != null)
Branches = view.ToTable();
tvBranches.DataBind();
foreach (RadTreeNode parent in tvBranches.Nodes)
{
foreach (RadTreeNode child in parent.Nodes)
{
for (int j = 0; j < Branches.Rows.Count; j++)
{
if (parent.Attributes["ItemValue"].ToString() == Branches.Rows[j][0].ToString().Trim())
{
parent.Checked = true;
}
if (child.Attributes["ItemValue"].ToString() == Branches.Rows[j][1].ToString().Trim())
{
child.Checked = true;
}
}
}
}