Populating the TreeView control from the SQL server in C# .NET application [modified]
-
How can I populate the treeview from the SQL server by using the ID and Parent ID of the node? :confused: -- modified at 4:07 Saturday 23rd June, 2007
Joseph Thachil +91 9916025724
I suspect you'd have to iterate over the data, I don't think a tree view is a data bound control. If it doesn't have a data source property, you need to do it 'by hand'.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
I suspect you'd have to iterate over the data, I don't think a tree view is a data bound control. If it doesn't have a data source property, you need to do it 'by hand'.
Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
I can add parent node and child node, but i can't add child of child node.
+91 9916025724 Joseph Thachil
Its possible to add child of child nodes. TreeView TreeView1=new TreeView(); foreach (TreeNode tn in TreeView1) { TreeNode tn1; if (TreeView1.Nodes[intTreeCount].Value == treeNodeValue) { tn.Nodes.Add(tn1); } int childcount=tn1.ChildNodes.Count; if(childcount>0) { tn1.childNodes.Add(tn2); } and so on....
I was born dumb!! :laugh:Programming made me laugh:laugh:!!! --sid--