Hi you can use like this.
Suppose If you have two columns (ParentID and ChildID), You can filter Child rows and bind it to the new treenodes.
private void AddNode(DataTable dt, string ChildID, TreeNode childnode)
{
DataRow[] dr = dt.Select("ParentID ='" + ChildID+ "');
foreach (DataRow drChild in dr)
{
TreeNode childnode1 = new TreeNode();
childnode1.Text = drChild["Name"];
childnode.Nodes.Add(childnode1);
AddNode(dtChild, drChild["ChildID"].ToString(), childnode1);
}
}
-Thanks
Sharath