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

Simple question on Treeview?

Hello

Thanks for reviewing my question. I would like to know how can I programmatically select a node

Thanks in Advanc
Peter
Nov 15 '05 #1
3 2140
Peter,

If it is the TreeView Control; try this
Gets or sets a TreeNode object that represents the selected node in the
TreeView control. Please start here"
http://longhorn.msdn.microsoft.com/l...webcontrols/c/
treeview/p/selectednode.aspx

<%@ Page Language="C#" %>

<script runat="server">

void SpacingIndex_Changed(Object sender, EventArgs e)
{

// Set the vertical spacing of the selected node based on the value
selected by the user.
LinksTreeView.SelectedNodeStyle.VerticalPadding =
Convert.ToInt32(SpacingList.SelectedItem.Text);

}

void ColorIndex_Changed(Object sender, EventArgs e)
{

// Set the foreground (font) color of the selected node based on
the value selected by the user.
LinksTreeView.SelectedNodeStyle.ForeColor =
System.Drawing.Color.FromName(ColorList.SelectedIt em.Text);

}

void Select_Change(Object sender, EventArgs e)
{

Message.Text = "You selected: " + LinksTreeView.SelectedNode.Text;

}

--------------------
Thread-Topic: Simple question on Treeview?
thread-index: AcQCF4+B4d7YB7S9Tay6VlBKJ7Y7hQ==
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp
From: "=?Utf-8?B?UGV0ZXI=?=" <an*******@discussions.microsoft.com>
Subject: Simple question on Treeview?
Date: Thu, 4 Mar 2004 10:36:08 -0800
Lines: 6
Message-ID: <49**********************************@microsoft.co m>
MIME-Version: 1.0
Content-Type: text/plain;
charset="Utf-8"
Content-Transfer-Encoding: 7bit
X-Newsreader: Microsoft CDO for Windows 2000
Content-Class: urn:content-classes:message
Importance: normal
Priority: normal
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
Newsgroups: microsoft.public.dotnet.languages.csharp
Path: cpmsftngxa06.phx.gbl
Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.languages.csharp:226424
NNTP-Posting-Host: tk2msftcmty1.phx.gbl 10.40.1.180
X-Tomcat-NG: microsoft.public.dotnet.languages.csharp

Hello,
Thanks for reviewing my question. I would like to know how can I
programmatically select a node?

Thanks in Advance
Peter


Cheers,

johnKn [MS-SDK]

-Please do not send email directly to this alias. This alias is for
newsgroup purposes only
-This posting is provided “AS IS” with no warranties, and confers no rights.

-To provide additional feedback about your community experience please send
e-mail to: sd*****@microsoft.com

Nov 15 '05 #2
John

First, I am using a Treeview in a form. Next, I you might misunderstood my question. I want to select a specific node not find out which node is selected. I know I can find the selected node by the property .SelectedNode. Any clues

Many Thank
Peter
Nov 15 '05 #3
> First, I am using a Treeview in a form. Next, I you might misunderstood
my question. I want to select a specific node not find out which node is
selected. I know I can find the selected node by the property
..SelectedNode. Any clues?

Why not simply set SelectedNode to point to the node you want? I could be
wrong, but I think that's all you have to do.

Remember, each of the nodes is really a pointer... so is SelectedNode.

Nov 15 '05 #4

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

Similar topics

42
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
1
by: Eric Law | last post by:
I want to create a simple applicaiton similar to the MSDN viewer with the tree view on the left and diplay html page on the right depends on the tree selection. any idea where I can get a sample of...
5
by: SoKool | last post by:
Can anyone point me to a site where I can get a free treeview control to use in ASP .NET or any tutorial that can help me build my own treeview control. I intend to use a treeview to generate a...
3
by: Peter | last post by:
Hello, We are inserting a side menu to our application using a class that is writing HTML on all our pages. This is a part of the code as an example: writer.Write(" <table WIDTH=""100%""...
7
by: Metal Rabbit | last post by:
Hi guys I'm needing to create a fairly complex TreeView, but am faltering on a very basic step (as you will gather, I'm new-ish to .net). Simplified, I can't get the creation of two nodes...
6
by: L.M | last post by:
Hello, I knew how to use the treeview under VB6. After migrating to .NET, well, I'm lost. I try to add a new node, either to the same level or as a child to a selected node in the treeview....
14
by: Mr.D | last post by:
How do I save/load the contents of a Treeview to a file? I have found several good examples written i VB6, but not a single one for VB.NET. Please help. ---- Tim
2
by: metaperl | last post by:
Hello, I'm trying to get the MSDN documentation example of a treeview to work: http://msdn2.microsoft.com/en-us/library/system.windows.forms.treeview.aspx I made the function static and added a...
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...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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...

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.