473,397 Members | 1,972 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,397 software developers and data experts.

TreeView problem

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" AutoEventWireup="true"
CodeFile="ShowDatabases.aspx.cs" Inherits="ShowDatabases"
Title="Untitled Page" %><%@ MasterType VirtualPath="Master1.master" %>

In the slave page I'm creting and populating a TreeView which I would
like to pass to my MasterPage , where exists a TreeView Control.So I've
defined a function
//MasterPage code,

public void FetchTree(TreeView dbs)
{
//the right code ;) // tried TreeView2 = dbs; but fails
}

//slave page code

Master.FetchTree(treeCreatedInSlave);

(There's no doubt about code, because when I type Master. the
IntelliSense sees the FetchTree method. I'm telling this, because my
problem is only in the tree.)

So how to do it without
I know I could build XML from slave tree and then get that XML in master
but I belive there's a faster way!

Thanks!!!
Nov 25 '05 #1
4 1367

Really nobody :(

Maybe I've described the problem wrong. So I repeat:

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
What do you mean by 'site'?

If it's just another page and session remains..?
You can store it in a session or flat (xml)file.
If it's the same app. you could try to use previous page object and enum the
parts over.
Not sure if that will work.

"christof" <no****@nomail.de> schreef in bericht
news:eR**************@TK2MSFTNGP15.phx.gbl...

Really nobody :(

Maybe I've described the problem wrong. So I repeat:

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 #3
Edwin Knoppert wrote:
What do you mean by 'site'?

If it's just another page and session remains..?
You can store it in a session or flat (xml)file.
If it's the same app. you could try to use previous page object and enum the
parts over.
Not sure if that will work.


There is no problem with storing it, but how to make the other TreeView
just exactly the same as one that I've created. So some kind of copying
objects.

TreeView2 is on a MasterPage
TreeView1 is on other page

TreeView2 = TreeView1;

So I've got exactly the same tree in both sites!
That's what I'm asking, thanks
Nov 27 '05 #4
There was a question about getting controls on such pages a few days ago.
Then i assume simply copying properties?
Like styles and such.
+ copying the items of course.

"christof" <no****@nomail.de> schreef in bericht
news:ev**************@TK2MSFTNGP12.phx.gbl...
Edwin Knoppert wrote:
What do you mean by 'site'?

If it's just another page and session remains..?
You can store it in a session or flat (xml)file.
If it's the same app. you could try to use previous page object and enum
the parts over.
Not sure if that will work.


There is no problem with storing it, but how to make the other TreeView
just exactly the same as one that I've created. So some kind of copying
objects.

TreeView2 is on a MasterPage
TreeView1 is on other page

TreeView2 = TreeView1;

So I've got exactly the same tree in both sites!
That's what I'm asking, thanks

Nov 27 '05 #5

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

Similar topics

4
by: Ian Powell | last post by:
Hi I've got objects in an sorted ArrayList like: P:\ P:\\DOCS P:\\i386 P:\\i386\ASMS P:\\i386\ASMS\1000 P:\\i386\ASMS\1000\MSFT
0
by: Björn Bengtsson | last post by:
Hello! I have an urgent problem concerning ASP.NET, ADO.NET, SQL Server, XML and the TreeView control. I have two tables; one describing the products and one describing their relationships. A...
4
by: Karim El Jed | last post by:
Hi, I'm trying to expand a special Node of my TreeView from Codebehind. I have a TreeView on a page for navigating to another site. On the other tsite here is the same TreeView more precisely a...
14
by: Evan Kontos | last post by:
I am trying to implement a Treeview w/an XML file and I even copied and pasted examples from MSDN but can't get them to work. Any suggestions welcome. XML File <TREENODES> <TREENODE...
4
by: Jeff Beem | last post by:
I have a class that inherits from TreeView. The treeview has tooltips for the nodes but they're showing up behind the form. Has anyone seen this? Are there any known fixes? Thanks in advance,...
3
by: christof | last post by:
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");...
3
by: William Sullivan | last post by:
I desperately want to replace my hand-made ajax treeview with the 2.0 TreeView. The webpage I'm designing uses the postbacks to dynamically fill the treeview. The reason why I'm doing this is...
8
by: Matt MacDonald | last post by:
Hi All, I have a form that displays hierarchical categories in a treeview. Ok so far so good. What I was to do is have users be able to select a node in the treeview as part of filling out the...
1
by: Nikron | last post by:
Hi, I'm having an issue with the ASP.NET 2.0 Treeview control and persisting its' state accross requests. My Control is embedded within a master page and is used for site navigation. My problem...
0
by: bsturg21 | last post by:
Hello, I have an app that has a custom treeview which inherits the base treeview class and I am having a problem with the way the treeview is being redrawn. Each node in the treeview represents a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.