Binding treeview[urgent plz]
-
hai....help me plz....urgent i create data table for treeview lik dis with hospital name as treenodes|Dr names as subnodes .. Apolo|Dr.jhon Image|Dr.Krish Care|Dr.Ram Apolo|Dr.sri Image|Dr.prabhu Care|Dr.san i want treeview display lik dis.... -.Apolo . . . . . .Dr.jhon . .Dr.sri . -Image . . . . . .Dr.prabhu . .Dr.Krish . -Care . . .Dr.Ram .Dr.san but in treeview it displaying lik dis..it opening in another treenodes with single name.. -.Apolo . . . . . .Dr.jhon . . -Image . . . . . .Dr.prabhu . . -Care . . .Dr.Ram -.Apolo . . . . . . .Dr.sri . -Image . . . . . . .Dr.Krish . -Care . . .Dr.san thanqu....:)
-
hai....help me plz....urgent i create data table for treeview lik dis with hospital name as treenodes|Dr names as subnodes .. Apolo|Dr.jhon Image|Dr.Krish Care|Dr.Ram Apolo|Dr.sri Image|Dr.prabhu Care|Dr.san i want treeview display lik dis.... -.Apolo . . . . . .Dr.jhon . .Dr.sri . -Image . . . . . .Dr.prabhu . .Dr.Krish . -Care . . .Dr.Ram .Dr.san but in treeview it displaying lik dis..it opening in another treenodes with single name.. -.Apolo . . . . . .Dr.jhon . . -Image . . . . . .Dr.prabhu . . -Care . . .Dr.Ram -.Apolo . . . . . . .Dr.sri . -Image . . . . . . .Dr.Krish . -Care . . .Dr.san thanqu....:)
-
hai....help me plz....urgent i create data table for treeview lik dis with hospital name as treenodes|Dr names as subnodes .. Apolo|Dr.jhon Image|Dr.Krish Care|Dr.Ram Apolo|Dr.sri Image|Dr.prabhu Care|Dr.san i want treeview display lik dis.... -.Apolo . . . . . .Dr.jhon . .Dr.sri . -Image . . . . . .Dr.prabhu . .Dr.Krish . -Care . . .Dr.Ram .Dr.san but in treeview it displaying lik dis..it opening in another treenodes with single name.. -.Apolo . . . . . .Dr.jhon . . -Image . . . . . .Dr.prabhu . . -Care . . .Dr.Ram -.Apolo . . . . . . .Dr.sri . -Image . . . . . . .Dr.Krish . -Care . . .Dr.san thanqu....:)
It is because you are adding everything to the TreeView's Nodes collection. You have to take care of the hierarchy, TreeView cannot automatically do it for you.
TreeNode hostpitalNode;
hostpitalNode = treeView1.Nodes.Add("Apolo");
hostpitalNode.Nodes.Add("Dr. Krish");And while posting, follow the guidelines, it is 'urgent' for you, not for others.
-
hai....help me plz....urgent i create data table for treeview lik dis with hospital name as treenodes|Dr names as subnodes .. Apolo|Dr.jhon Image|Dr.Krish Care|Dr.Ram Apolo|Dr.sri Image|Dr.prabhu Care|Dr.san i want treeview display lik dis.... -.Apolo . . . . . .Dr.jhon . .Dr.sri . -Image . . . . . .Dr.prabhu . .Dr.Krish . -Care . . .Dr.Ram .Dr.san but in treeview it displaying lik dis..it opening in another treenodes with single name.. -.Apolo . . . . . .Dr.jhon . . -Image . . . . . .Dr.prabhu . . -Care . . .Dr.Ram -.Apolo . . . . . . .Dr.sri . -Image . . . . . . .Dr.Krish . -Care . . .Dr.san thanqu....:)
Marking the post as urgent and requesting urgent help is very rude around here. :mad:
I know the language. I've read a book. - _Madmatt
-
It is because you are adding everything to the TreeView's Nodes collection. You have to take care of the hierarchy, TreeView cannot automatically do it for you.
TreeNode hostpitalNode;
hostpitalNode = treeView1.Nodes.Add("Apolo");
hostpitalNode.Nodes.Add("Dr. Krish");And while posting, follow the guidelines, it is 'urgent' for you, not for others.
-
Marking the post as urgent and requesting urgent help is very rude around here. :mad:
I know the language. I've read a book. - _Madmatt
-
hai...sory sory...im new for thees messages ......i dono how 2 write...forgive me yar...:)
-
It is because you are adding everything to the TreeView's Nodes collection. You have to take care of the hierarchy, TreeView cannot automatically do it for you.
TreeNode hostpitalNode;
hostpitalNode = treeView1.Nodes.Add("Apolo");
hostpitalNode.Nodes.Add("Dr. Krish");And while posting, follow the guidelines, it is 'urgent' for you, not for others.
hai...Shameel.....yah i tried ..but again it displaying in hierarchy manner...i dont want Dr's name displaying in another same hospital name.... (actuly i given in Data table ,,in same hospital name with 2 Dr's names....but...its displaying in 2 different treenodes...i want 2 show in single hospital name with 2 Dr's names) Apolo|Dr.jhon Image|Dr.Krish Care |Dr.Ram Apolo|Dr.sri Image|Dr.prabhu Care |Dr.san public void TreeviewBind() { query= "Select * from Clinic_tbl"; da = new SqlDataAdapter(query, con); DataSet ds = new DataSet(); da.Fill(ds, "Clinic"); foreach (DataRow row in ds.Tables[0].Rows) { rootNode = treeView1.Nodes.Add(row[0].ToString()); rootNode.Nodes.Add(row[1].ToString()); } } i hope u understod my lang..im new for Dotnet...this is my 1st project.........thanqu:)
-
hai...Shameel.....yah i tried ..but again it displaying in hierarchy manner...i dont want Dr's name displaying in another same hospital name.... (actuly i given in Data table ,,in same hospital name with 2 Dr's names....but...its displaying in 2 different treenodes...i want 2 show in single hospital name with 2 Dr's names) Apolo|Dr.jhon Image|Dr.Krish Care |Dr.Ram Apolo|Dr.sri Image|Dr.prabhu Care |Dr.san public void TreeviewBind() { query= "Select * from Clinic_tbl"; da = new SqlDataAdapter(query, con); DataSet ds = new DataSet(); da.Fill(ds, "Clinic"); foreach (DataRow row in ds.Tables[0].Rows) { rootNode = treeView1.Nodes.Add(row[0].ToString()); rootNode.Nodes.Add(row[1].ToString()); } } i hope u understod my lang..im new for Dotnet...this is my 1st project.........thanqu:)
Your code does what you have asked it to do. It is your headache to find out if the hospital is already added to the TreeView and add your doctor there. Hint: Use treeView1.Nodes.Find() to find out if the hospital is already added. Your first problem is that your table is not normalized.