Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

TreeView Node Tag

Posted on 2006-11-16
3
Medium Priority
?
324 Views
Last Modified: 2011-09-20
Hi Experts,

I have a treeview in my program and wanted to add more details to a node so i created a structure which i than attached to each node.  The problem i am having is that i am not sure how to refer back to the values stored on the tag.  I assumed it would just be something like: node.tag.name but this does not work.

Here is my code:

    Private Structure ProductStruc
        Friend Name As String
        Friend Type As String
        Friend Details As String
        Friend Notes As String
        Friend Qty As Integer
        Friend IsAddition As Boolean
    End Structure

            Dim NodeInfo As ProductStruc
            NodeInfo.Details = Trim(DetailsTXT.Text)
            NodeInfo.IsAddition = IsAddition
            NodeInfo.Name = Trim(ProductCMB.Text)
            NodeInfo.Notes = Trim(ProdNotesTXT.Text)
            NodeInfo.Qty = QuantityNUM.Value
            NodeInfo.Type = Trim(ProdTypeCMB.Text)

            CurComputerNode = ProdView.Nodes.Add(Trim(DetailsTXT.Text))
            CurComputerNode.Tag = NodeInfo

Cheers for any help!
0
Comment
Question by:SteSi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Expert Comment

by:Mohamed Zedan
ID: 17954481
All you have to do to get what you want is ctype(CurComputerNode.Tag ,NodeInfo).Name
or

dim ni as NodeInfo = ProdView.SelectedNode.tag
'Then use ni as you like .... it is all a matter of casting tag to the right type :)


hope this helps :)
0
 
LVL 5

Expert Comment

by:Venkateswarlu Kaipu
ID: 17954768
dim NodeDetails

NodeDetails = ProdView.SelectedItem.tag

Msgbox NodeDetails
0
 
LVL 7

Accepted Solution

by:
Mohamed Zedan earned 1000 total points
ID: 17954783
Sorry I typed nodeinfo instead of ProductStruc thought it was the structure name :)


All you have to do to get what you want is ctype(CurComputerNode.Tag ,ProductStruc).Name
or

dim ni as ProductStruc = ProdView.SelectedNode.tag
'Then use ni as you like .... it is all a matter of casting tag to the right type :)


hope this helps :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question