|
-
Oct 18th, 2003, 09:18 AM
#1
Thread Starter
New Member
Setting the currrent selected treeview node
I have a tree view that loads the details of an item into another panel. If those items are edited, and the user selects another tree view item, they are asked if they want to save changes. If they click Cancel, then the original node needs to be reselected. However, the problem is that it appears all of the node selected properties are read-only. Is there a way to set the selected node?
I've tried stuff like...
Code:
tvwSwatches.SelectedNode = tvwSwatches.Nodes(CurrentSwatchNode)
But that throws System.ArgumentOutOfRangeException
Any ideas?
-
Oct 18th, 2003, 02:49 PM
#2
What is CurrentSwatchNode set to in your test? Remember that you have to follow the hierarchy structure of the nodes. Maybe this will help: http://www.vbforums.com/showthread.p...hreadid=236652
-
Oct 18th, 2003, 04:52 PM
#3
why dont you just do
tvwSwatches.SelectedNode = CurrentSwatchNode
?
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Oct 19th, 2003, 01:07 PM
#4
Thread Starter
New Member
CurrentSwatchNode is an integer that is assigned the node index when the user first selects it. The node tree isn't changing, so I'm assuming this method would work (either this or getting the node with its path)
-
Oct 19th, 2003, 02:14 PM
#5
well you could just save the node as a TreeNode, and I think it would work
rate my posts if they help ya!
Extract thumbnail without reading the whole image file: (C# - VB)
Apply texture to bitmaps: (C# - VB)
Extended console library: (VB)
Save JPEG with a certain quality (image compression): (C# - VB )
VB.NET to C# conversion tips!!
-
Oct 19th, 2003, 06:06 PM
#6
Yeah saving a reference to the node itself would be much easier. Then you can use the code MrPolite posted.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|