HighTechTalks DotNet Forums  

What event tells me the user has selected a not in the TreeView?

Dotnet Framework (SDK) microsoft.public.dotnet.framework.sdk


Discuss What event tells me the user has selected a not in the TreeView? in the Dotnet Framework (SDK) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
David Thielen
 
Posts: n/a

Default What event tells me the user has selected a not in the TreeView? - 11-08-2009 , 05:30 PM






AfterSelect gets fired when the tree is first populated even though
the user did not click on a node.

I need an event when the user single clicks on a leaf in the tree -
but not if they scroll and expand/collapse nodes.

thanks - dave

david@at-at-at (AT) windward (DOT) dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm

Reply With Quote
  #2  
Old   
CSharpner
 
Posts: n/a

Default Re: What event tells me the user has selected a not in the TreeView? - 11-11-2009 , 02:19 PM






One option is to set a value in the MouseClick event. Then, in your
AfterSelect event handler, check that value. If it hasn't been set,
you know this is the initial trigger, otherwise, it's a user initiated
event.

Alternatively, initialize a counter to zero in your constructor, then
in the AfterSelect event handler, check the value of the counter. If
it's zero, increment and bail. If it's above zero, it's a user
initiated event.

HTH
http://csharper.blogspot.com

On Nov 8, 6:30*pm, David Thielen <thie... (AT) nospam (DOT) nospam> wrote:
Quote:
AfterSelect gets fired when the tree is first populated even though
the user did not click on a node.

I need an event when the user single clicks on a leaf in the tree -
but not if they scroll and expand/collapse nodes.

thanks - dave

david (AT) at-at (DOT) .. (AT) windw...T) dot.dot.net
Windward Reports --http://www.WindwardReports.com
me --http://dave.thielen.com

Cubicle Wars -http://www.windwardreports.com/film.htm

Reply With Quote
  #3  
Old   
CSharpner
 
Posts: n/a

Default Re: What event tells me the user has selected a not in the TreeView? - 11-11-2009 , 02:20 PM



One option is to set a value in the MouseClick event. Then, in your
AfterSelect event handler, check that value. If it hasn't been set,
you know this is the initial trigger, otherwise, it's a user initiated
event.

Alternatively, initialize a counter to zero in your constructor, then
in the AfterSelect event handler, check the value of the counter. If
it's zero, increment and bail. If it's above zero, it's a user
initiated event.

HTH
http://csharpner.blogspot.com

On Nov 8, 6:30*pm, David Thielen <thie... (AT) nospam (DOT) nospam> wrote:
Quote:
AfterSelect gets fired when the tree is first populated even though
the user did not click on a node.

I need an event when the user single clicks on a leaf in the tree -
but not if they scroll and expand/collapse nodes.

thanks - dave

david (AT) at-at (DOT) .. (AT) windw...T) dot.dot.net
Windward Reports --http://www.WindwardReports.com
me --http://dave.thielen.com

Cubicle Wars -http://www.windwardreports.com/film.htm

Reply With Quote
  #4  
Old   
Wilson, Phil
 
Posts: n/a

Default Re: What event tells me the user has selected a not in the TreeView? - 11-19-2009 , 11:48 AM



I think I've detoured this by adding the events myself after the tree has
been populated.
--
Phil Wilson
The Definitive Guide to Windows Installer
http://www.apress.com/book/view/1590592972


"David Thielen" <thielen (AT) nospam (DOT) nospam> wrote

Quote:
AfterSelect gets fired when the tree is first populated even though
the user did not click on a node.

I need an event when the user single clicks on a leaf in the tree -
but not if they scroll and expand/collapse nodes.

thanks - dave

david@at-at-at (AT) windward (DOT) dot.dot.net
Windward Reports -- http://www.WindwardReports.com
me -- http://dave.thielen.com

Cubicle Wars - http://www.windwardreports.com/film.htm

Reply With Quote
Reply




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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.