2
Answers

how to bind multiple images to tree node.

sree hari

sree hari

14y
9.3k
1
Hi Guys,

how to bind multiple images  to tree node.

i can bind one image using IMAGE URL property... ..i need implement edit,save,delete images to tree view parent and child nodes.

if (ds.Tables[0].Rows.Count > 0)
            {
                TreeView1.Nodes.Clear();
                foreach (DataRow masterRow in ds.Tables[0].Rows)
                {
                    TreeNode masterNode = new TreeNode((string)masterRow["ParentName"], Convert.ToString(masterRow["ParentId"]), "~/Images/xxx.bmp");
                    TreeView1.Nodes.Add(masterNode);
                   

                    foreach (DataRow childRow in masterRow.GetChildRows("Children"))
                    {
                        TreeNode childNode = new TreeNode((string)childRow["ChildName"], Convert.ToString(childRow["ParentId"]));
                        childNode.ImageUrl = "~/Images/yyy.bmp";
                        masterNode.ChildNodes.Add(childNode);
                    }


                }
            }

Answers (2)