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

TreeView properties treeNodeSrc - treeNodeTypeSrc

Hi all,
I have a silly problem with treeview. I'm using .NET 2.0. I need to
set the two properties treeNodeSrc - treeNodeTypeSrc at run time using
C#, but in the treeViews that I define, these two properties don't
exist!!!
Do I need to import something more to use all the properties of the
treeview? Right now, I 've just installed .NET 2005

Thank you all

Bruno

Oct 18 '07 #1
3 2106
How exactly do you know you need to set two properties
that don't exist?

That said...

Use the .Tag property of the node to store a custom
class in. Whenever you grab a node, get the custom
class back out of the .Tag

MyCustomClass blah = (MyCustomClass)node.Tag;

--
Robbe Morris [Microsoft MVP - Visual C#]
..NET PropertyGrid Control - ListBox, ComboBox, and Custom Classes
http://www.eggheadcafe.com/tutorials...d-control.aspx


"ippo" <ip************@yahoo.itwrote in message
news:11*********************@q5g2000prf.googlegrou ps.com...
Hi all,
I have a silly problem with treeview. I'm using .NET 2.0. I need to
set the two properties treeNodeSrc - treeNodeTypeSrc at run time using
C#, but in the treeViews that I define, these two properties don't
exist!!!
Do I need to import something more to use all the properties of the
treeview? Right now, I 've just installed .NET 2005

Thank you all

Bruno
Oct 18 '07 #2
On Oct 18, 9:48 pm, "Robbe Morris - [MVP] C#" <i...@eggheadcafe.com>
wrote:
How exactly do you know you need to set two properties
that don't exist?

That said...

Use the .Tag property of the node to store a custom
class in. Whenever you grab a node, get the custom
class back out of the .Tag

MyCustomClass blah = (MyCustomClass)node.Tag;

--
Robbe Morris [Microsoft MVP - Visual C#]
.NET PropertyGrid Control - ListBox, ComboBox, and Custom Classeshttp://www.eggheadcafe.com/tutorials/aspnet/270e9432-d236-47e7-b1af-5...

"ippo" <ippolito79-...@yahoo.itwrote in message

news:11*********************@q5g2000prf.googlegrou ps.com...
Hi all,
I have a silly problem with treeview. I'm using .NET 2.0. I need to
set the two properties treeNodeSrc - treeNodeTypeSrc at run time using
C#, but in the treeViews that I define, these two properties don't
exist!!!
Do I need to import something more to use all the properties of the
treeview? Right now, I 've just installed .NET 2005
Thank you all
Bruno- Hide quoted text -

- Show quoted text -
There are a lot of example, even in MSDN environment, using that two
properties to populate a treview. My problem is just that, in my .NET
installation, I cannot see those properties. It seems they are not
part of treeview objects I define, so I was asking if there was
something to include to use all treeview webcontrols features

Thank you
Bruno

Oct 19 '07 #3
Since you are using a treeview I thought I would maybe you could help
me. I am new to C# and using the treeview in Windows forms. I can
connect to the DB (SQL 2005), create the dataadapter, populate a data
set. The problem is how to use the dataset to populate a treeview.

I have not found a Windows Forms C# example that can handle an
unspecified level of node nesting and Parent = Child. See child rows
15.

I would really appreciate the help.

Thank you.

I have a SQL Server 2005 table containing this data shown below.
Child...Parent...Depth.....Hierarchy
1.........NULL.....0.........01
2..........1.......1..........01.02
5..........2.......2..........01.02.05
6..........2.......2..........01.02.06
3..........1.......1..........01.03
7..........3.......2..........01.03.07
11.........7.......3..........01.03.07.11
14.........11......4..........01.03.07.11.14
12.........7.......3..........01.03.07.12
13.........7.......3..........01.03.07.13
8..........3.......2..........01.03.08
9..........3.......2..........01.03.09
4..........1.......1..........01.04
10.........4.......2..........01.04.10
15.........NULL....0..........15
15.........15......1..........15.15
16.........15......1..........15.16
18.........16......2..........15.16.18
17.........15......1..........15.17
On Thu, 18 Oct 2007 10:20:29 -0700, ippo <ip************@yahoo.it>
wrote:
>Hi all,
I have a silly problem with treeview. I'm using .NET 2.0. I need to
set the two properties treeNodeSrc - treeNodeTypeSrc at run time using
C#, but in the treeViews that I define, these two properties don't
exist!!!
Do I need to import something more to use all the properties of the
treeview? Right now, I 've just installed .NET 2005

Thank you all

Bruno
Oct 22 '07 #4

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

Similar topics

0
by: John Ruiz | last post by:
PRE-SCRIPT: This has ASCII diagrams. I built them using a fixed-width font, so looking at them in a proportional font may make my pretty drawings quite ugly. GIVEN: ROOT |
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...
1
by: David Elliott | last post by:
I am trying to use the TreeView Control that is part of the WebControls package from Microsoft. I was getting this error: Exception Details: System.Xml.XmlException: The data at the root level...
0
by: volts | last post by:
Hello, When building a Microsoft.Web.UI.WebControls.TreeView with multiple XML files, all of the databound nodes of the tree are not loaded at once. When the TreeNodeSrc property is set for a...
2
by: Chris | last post by:
Hi, anyone experience with the TreeView control that is available in the Microsoft.Web.UI.WebControls component ? I want to add a few nodes to the TreeView-control but don't know quite how :...
4
by: Aidan Marcuss | last post by:
I am seeing significant performance problems with the TreeView (from the Microsoft.Web.UI.WebControls namespace) when trying to data bind it on the server side. I set the TreeNodeSrc property and...
0
by: claireCSHARPuser | last post by:
Hi I'm having a problem with a tree view. The data source for this an XML string set using the TreeView.TreeNodeSrc property in the code behind page. The XML is generated by a stored procedure...
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...
0
by: kenny | last post by:
Sanity Check please: Trying to resolve the following condition: Website initial page load is extremly slow (50 secs) when accessing site through CSS (load balancer) with http://alias. Code...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.