473,287 Members | 3,319 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

TreeView problem

I've got a really easy problem, please help me:

There are two pages in one I'm creating a TreeView like that:

TreeView dbTree = new TreeView();

TreeNode dbTreeRoot = new TreeNode("Root");
dbTree.Nodes.Add(dbTreeRoot);
..
..

- so my complete TreeView is populated in that code.
Now I wish to pass this whole TreeView to another site, where I've got
my TreeView Control:

<asp:TreeView ID="TreeView2" runat="server">
</asp:TreeView>

So how to pass this tree to put it into that control??

I thing that it should be a function in the second page:

public void FetchTree(TreeView source_tree)
{
// - the code, I've tried TreeView2 = source_tree, but it's not a solution
}

Or the only way is to save a TreeView to XML in a first, and then to
retrive it from XML in a second page to the control directly.

Thank you in advance!
Nov 27 '05 #1
3 3775
Hi christof
you will have to save treeview controls data somewhere and pass this data to
other page
you could use Session, Application state to use this

I suggest you to pass encoded XML to second page and then read it and build
second tree

Hope this help

--
Galin Iliev [MCSD, MCSD.NET]
Senior Software Developer
www.wordassist.com

"christof" <no****@nomail.de> wrote in message
news:u9*************@TK2MSFTNGP11.phx.gbl...
I've got a really easy problem, please help me:

There are two pages in one I'm creating a TreeView like that:

TreeView dbTree = new TreeView();

TreeNode dbTreeRoot = new TreeNode("Root");
dbTree.Nodes.Add(dbTreeRoot);
..
..

- so my complete TreeView is populated in that code.
Now I wish to pass this whole TreeView to another site, where I've got my
TreeView Control:

<asp:TreeView ID="TreeView2" runat="server">
</asp:TreeView>

So how to pass this tree to put it into that control??

I thing that it should be a function in the second page:

public void FetchTree(TreeView source_tree)
{
// - the code, I've tried TreeView2 = source_tree, but it's not a
solution
}

Or the only way is to save a TreeView to XML in a first, and then to
retrive it from XML in a second page to the control directly.

Thank you in advance!

Nov 27 '05 #2
Galin iliev wrote:
Hi christof
you will have to save treeview controls data somewhere and pass this data to
other page
you could use Session, Application state to use this

I suggest you to pass encoded XML to second page and then read it and build
second tree

Hope this help


But you mean to do xml from scratch?

XmlDocument ...
...
or is there a ready method TreeView -> XML?

Thanks
Nov 27 '05 #3
There is no method until .net 2.0

christof wrote:
Galin iliev wrote:
Hi christof
you will have to save treeview controls data somewhere and pass this
data to other page
you could use Session, Application state to use this

I suggest you to pass encoded XML to second page and then read it and
build second tree

Hope this help


But you mean to do xml from scratch?

XmlDocument ...
...
or is there a ready method TreeView -> XML?

Thanks

Nov 27 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: sai bo shan via DotNetMonster.com | last post by:
hi, i got a problem with CSharp TreeView control. how can i Find/Search a Node in TreeView. please help me! SBS --
6
by: Jan Krouwer | last post by:
I have a treeview which is populated from a relational database. In order to copy part of the tree, I need to add to the database the relationship of the part of the tree to be copied but with new...
3
by: johnb41 | last post by:
In my treeview, I need each node to hold a "value", not just text/label. Kind of like how a ListBox item has text, and a value associated with it. I need this because when a node is clicked, i...
4
by: christof | last post by:
It'll be really easy...Sorry for that question: I've got a MasterPage <%@ Master Language="C#" ClassName="MasterP" %> and some slave.aspx.<%@ Page Language="C#" MasterPageFile="~/Master1.master"...
0
by: R.A.M. | last post by:
Hi, I need your help in a problem of simple TreeView definition. I have in .aspx: <asp:TreeView ID="Directories" runat="server" /> which is filled in (in behind-code) with directories and files...
1
by: tanya foster | last post by:
Hello, I have populated a treeview in asp.net 2.0 from an xmldocument. The treeview structure in the asp web page looks something like... -orderdata -order -lines -operations -materials...
1
by: Rick | last post by:
Hi guys! I have a problem with a master page that has a treeview control as menu, i have a root node, 5 parents and each parent has 10 leafs, 50 pages in total, each page is linked to master...
6
by: David | last post by:
Hi all, I am opening a webform with showModalDialog. This appears to pop-up fine, though I have a problem... Inside the webform is a treeview control. When the treeview is populated, I am...
0
by: =?Utf-8?B?TWlrZSBDb2xsaW5z?= | last post by:
I have a treeview, which is in an accordion, which is in an updatepanel. When I click on a node in the treeview, it loads up a control as it should. When I click on the same node again, the...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.