protected void BindProjectModuleTree() { DataSet ds = BLL_Infra_ShipSettings.Get_Project_Module_Tree(Convert.ToInt32(Session["USERID"].ToString())); if (ds.Tables.Count > 0) { int meni = 0; int child = 0; foreach (DataRow dr in ds.Tables[0].Rows) { TreeNode mi = new TreeNode(dr["Name"].ToString().Trim(), dr["Project_ID"].ToString()); TreeView1.Nodes.Add(mi); DataRow[] drInners = ds.Tables[1].Select("Project_ID ='" + dr["Project_ID"].ToString() + "' "); if (drInners.Length != 0) { foreach (DataRow drInner in drInners) { TreeNode miner; miner = new TreeNode(drInner["Name"].ToString().Trim(), drInner["Module_ID"].ToString()); TreeView1.Nodes[meni].ChildNodes.Add(miner); /////////////// DataRow[] drInners1 = ds.Tables[2].Select("Module_ID ='" + drInner["Module_ID"].ToString() + "' "); if (drInners1.Length != 0) { foreach (DataRow drInner1 in drInners1) { TreeNode miner1; miner1 = new TreeNode(drInner1["Name"].ToString().Trim(), drInner1["Screen_ID"].ToString()); miner.ChildNodes.Add(miner1); } miner.CollapseAll(); } ////////////////// TreeView1.Nodes[meni].CollapseAll(); child++; } } meni++; } } }