Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 2005 > C# 2005
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
C# 2005 For discussion of Visual C# 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# 2005 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 14th, 2006, 01:57 AM
Authorized User
 
Join Date: Jul 2006
Location: Schiedam, zuid holland, Netherlands.
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to select a node or text from treeview

Hi there

I am new to programming C# and programming in general so I am hoping you guys can help me.

I have to make a routine that connects a different data source to a data grid view using a treeview.

So I have to make a program with several if statements that selects a node or text. If a node with text “hello” is selected the data source should be X.

I hope my problem is clear en hope you can help me.

Greetings,

MacDevv




  #2 (permalink)  
Old September 4th, 2006, 12:17 PM
Authorized User
 
Join Date: Sep 2006
Location: , , India.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As_
System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect
Label1.Text = "You are here->" & " " & e.Node.FullPath
'displaying the path of the selected node
Label2.Text = "Current node selected:" & " " & e.Node.Text
'displaying the selected node
End Sub

u can try this code.And Let me know if it works

  #3 (permalink)  
Old September 4th, 2006, 12:18 PM
Authorized User
 
Join Date: Sep 2006
Location: , , India.
Posts: 66
Thanks: 0
Thanked 0 Times in 0 Posts
Default

this code is in VB.Net.But U cand easily change it for c#

  #4 (permalink)  
Old September 5th, 2006, 05:23 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: , , .
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Have a look at this discussion

http://p2p.wrox.com/topic.asp?TOPIC_ID=36915

Regards
Ankur
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmatically select a treeview node and expand simsen ASP.NET 2.0 Professional 0 June 23rd, 2008 01:57 AM
asp.net 2.0 treeview select node does not respond vhrao ASP.NET 2.0 Basics 0 February 17th, 2006 05:03 PM
Focusing on a node in a treeview (C# application) themuffinman_swe C# 5 November 27th, 2005 09:58 AM
Add node in ie treeview acko ASP.NET 1.x and 2.0 Application Design 0 January 28th, 2004 09:29 AM



All times are GMT -4. The time now is 02:56 PM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.