473,320 Members | 1,846 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,320 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 3779
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: 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...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.