How to fetch data from database in Tree view
-
Hi guys I have to fetch data from my database in treeview pattern. If anyone is familiar with this please help me out. And i want to make that treeview control sizeable. I mean like property and solution explorer in Visual Studio.So that any one can make it hide or change its size please help me Dj Rock
-
Hi guys I have to fetch data from my database in treeview pattern. If anyone is familiar with this please help me out. And i want to make that treeview control sizeable. I mean like property and solution explorer in Visual Studio.So that any one can make it hide or change its size please help me Dj Rock
Include Microsoft.Web.UI.WebControls.dll in your project. For runtime addition of nodes for TreeView control do following steps //On aspx page register TreeView as <%@ Page language="c#" Codebehind="TreeControl.aspx.cs" AutoEventWireup="false" Inherits="UserControlApplication.TreeControl" %> //Treeview Control //Add the root node for User Control Tree1 in .cs file TreeNode tNode = new TreeNode(); tNode.Text="Root"; tree1.Nodes.Add(tNode); //Add Child Node to root node tNode TreeNode tChileNode1 = new TreeNode(); tChileNode1.Text = str;//This string is the information retrieved form database tNode.Nodes.Add(tChileNode1); :-D
#Abhi#
-
Include Microsoft.Web.UI.WebControls.dll in your project. For runtime addition of nodes for TreeView control do following steps //On aspx page register TreeView as <%@ Page language="c#" Codebehind="TreeControl.aspx.cs" AutoEventWireup="false" Inherits="UserControlApplication.TreeControl" %> //Treeview Control //Add the root node for User Control Tree1 in .cs file TreeNode tNode = new TreeNode(); tNode.Text="Root"; tree1.Nodes.Add(tNode); //Add Child Node to root node tNode TreeNode tChileNode1 = new TreeNode(); tChileNode1.Text = str;//This string is the information retrieved form database tNode.Nodes.Add(tChileNode1); :-D
#Abhi#