SteSi
asked on
TreeView Node Tag
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(De tailsTXT.T ext))
CurComputerNode.Tag = NodeInfo
Cheers for any help!
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(De
CurComputerNode.Tag = NodeInfo
Cheers for any help!
dim NodeDetails
NodeDetails = ProdView.SelectedItem.tag
Msgbox NodeDetails
NodeDetails = ProdView.SelectedItem.tag
Msgbox NodeDetails
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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 :)