Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0treeviewtreeview
Previous
 
Next
New Post
7/7/2009 12:57 PM
 

hello again,

I need to make a treeview module. I already look to somehelp over the web about how to make a treeview with csharp.

But my problem is that I need to make a dynamic treeview with db acess, for any db.

 

Most of the hepl that I saw use nodes name write in code, not loading it from a db.

 

The output that I want to make for now is something like this:

treeview

table1

   ->row1

   ->row2

table2

    ->row1

.....

 

 
New Post
7/8/2009 10:39 PM
 

Use the DNNTree control and check out the code to populate it from a database in the DNNTreeNavigation provider in teh source project.

The Help module also uses the tree so you could look at that code as well for doing the whole thing down to the db and back.


Philip Beadle - Employee
 
New Post
7/9/2009 11:17 AM
 

But something in csharp? =(

 
New Post
7/9/2009 7:28 PM
 

Just use a language converter or learn VB.Net its the same .Net just a different syntax.. (enter all argumetns about C# and VB here )


Philip Beadle - Employee
 
New Post
7/10/2009 6:08 AM
 

For now I have this code that show me in a treeview the tables as mother nodes, but now I want to show on the child nodes the columns from each table, using that second dataset sql.

How can I make it?

 

/***************/

protected void Page_Load(System.Object sender, System.EventArgs e)
        {
            try
            {
                fill_tree();
            }
            catch (Exception exc) //Module failed to load
            {
                Exceptions.ProcessModuleLoadException(this, exc);
            }

        }

        void fill_tree()
        {
            DataSet ds = data_set("select * from Information_Schema.tables");

            TreeView1.Nodes.Clear();

            foreach (DataRow dr in ds.Tables[0].Rows)
            {
                TreeNode tn_parent = new TreeNode();

                tn_parent.Text = dr["TABLE_NAME"].ToString();
                tn_parent.PopulateOnDemand = true;
                tn_parent.ToolTip = "click to get child";
                tn_parent.SelectAction = TreeNodeSelectAction.SelectExpand;
                tn_parent.Expand();
                tn_parent.Selected = true;
                TreeView1.Nodes.Add(tn_parent);
                fill_child(tn_parent);
            }
        }

        public void fill_child(TreeNode parent)
        {
            DataSet dstwo = data_set("
/*** sql missing to show the columns for each table ***/ ");

            parent.ChildNodes.Clear();

            foreach (DataRow dr in dstwo.Tables[0].Rows)
            {
                TreeNode child = new TreeNode();
                child.Text = dr[
" /*** columns numbers or something like that =S ***/ "].ToString();

                if (child.ChildNodes.Count == 0)
                {
                    child.PopulateOnDemand = true;
                }

                child.ToolTip = "click to get child";
                child.SelectAction = TreeNodeSelectAction.SelectExpand;
                child.CollapseAll();
                parent.ChildNodes.Add(child);
            }
        }

/***************/

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0treeviewtreeview


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out