Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. How to fetch data from database in Tree view

How to fetch data from database in Tree view

Scheduled Pinned Locked Moved ASP.NET
csharpdatabasevisual-studiodata-structuresregex
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dj rock
    wrote on last edited by
    #1

    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

    A 1 Reply Last reply
    0
    • D 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

      A Offline
      A Offline
      Abhishek Joshi
      wrote on last edited by
      #2

      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#

      D 1 Reply Last reply
      0
      • A Abhishek Joshi

        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#

        D Offline
        D Offline
        dj rock
        wrote on last edited by
        #3

        hey abhi thank you so much i was not getting value before but now i made some changes and then its working great Thanks once again

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups