I Want To Bind DataTable To TreeView.I Have Written Following Code.Its Working Currently,Means It Displays All Data Of DataTable But No Root Node.
List
// Suppress repainting the TreeView until all the objects have been created.
treeView1.BeginUpdate();
// Clear the TreeView each time the method is called.
treeView1.Nodes.Clear();
// create root node
TreeNode root = new TreeNode("Root");
// loop and add all child nodes to root node
foreach (DataRow r in dt.Rows)
{
// create child node
// add to root node
root.Nodes.Add(child);
}
// add root node to tree view
treeView1.Nodes.Add(root);
// Begin repainting the TreeView.
treeView1.EndUpdate();