TreeView Check Box population

Aug 24 2010 9:07 AM
Hi everyone...

I have populated a treeview. (like Category.JPG in the zip file), Now I am getting the datatable containing the treeview node values. and on the basis of that I need to make "checked" the check boxes at the time of page load. I am getting the Parent nodes only by using the following code below. But unable to get the child nodes.

            DataTable dt = ds1.Tables[0];
            foreach (TreeNode node in TreeViewArticleCatagory.Nodes)
            {
                foreach (DataRow dr in dt.Rows)
                {
                    if (Convert.ToString(dr["Item"]) == node.Value)
                    {
                        node.Checked = true;
                        //TreeViewArticleCatagory.SelectedNode.Checked = true;
                    }
                }
            }

Please help me....

Thanks in advance.....

Attachment: Category.zip

Answers (1)