Treeview TAG |
Post Reply |
Author | |
bartstoppel
Newbie Joined: 23 March 2011 Status: Offline Points: 3 |
Post Options
Thanks(0)
Posted: 23 March 2011 at 5:28am |
I'm using the XTreme SuitePro ActiveX 2009 Vol4 (13.4.0) with Vb.NET. I tried to store additional data in the TAG-field of a treeview node like in this example:
Structure testSTRUCT Dim numb As Integer Dim pics As Boolean End Structure Private Sub StoreDataToNode Dim tvnode As TreeViewNode Dim nodeData As testSTRUCT = New testSTRUCT nodeData.numb = 13123 nodeData.pics = False tvnode = tvDemo.Nodes.Add(, , "F_1", "first node") tvnode.Tag = nodeData End Sub Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click StoreDataToNode() End Sub Running the program the debugger stops in the row "tvnode.Tag = nodeData" But i got the error "Der Wert liegt außerhalb des erwarteten Bereichs" (e.g. in english "The value is outside the expected range") in the line "tvnode.Tag = nodeData" after starting the program an clicking on the form. However if i only store an integer in the tag-field of my treeview node (like this: tvnode.Tag = 1), the programm run through the line above without any error. How can i store my additional data in the tag field? |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Hi,
I believe this is due to the nature of what can be stored in the Tag field. Tag fields can store either a single boolean, integer, string and more values. However I don't think they can store a reference to an object, structure or type. The best way would be to store your extra data in an array, then store the integer value of the array in the Tag field. |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
bartstoppel
Newbie Joined: 23 March 2011 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
Hi,
thanks for your reply. I'm a bit confused. The same way of proceeding to store additional data with VB-NET-structure in the tag-field operates in many different controls like microsoft treeview, microsoft listview, all purecomponents-controls, etc. without problems. But for my software i need markups, so i have to use the codejock treeview not the microsoft one that doesn't support markups. Perhaps i have to try your suggestion or i will do it with an collection to link the treeview node with the right collection item. |
|
Xander75
Senior Member Joined: 26 April 2007 Status: Offline Points: 353 |
Post Options
Thanks(0)
|
Hi,
I must admit I am coming from a VB6 environment and not VB.Net. However as a workaround the method I suggested would work fine in both instances to resolve your issue. |
|
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6) |
|
gibra
Senior Member Joined: 31 October 2008 Location: Italy Status: Offline Points: 288 |
Post Options
Thanks(0)
|
Codejock controls are COM objects, aren't NET objects.
You can use them on NET environment, is true, but the behavoir still native (COM.
In your case, Tag property is a Text type, so you can store strings only.
|
|
gibra
CJ SuiteControl v: 13.x to 19.x Windows 10 64bit VS2019 - VB6.0 SP6 <a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8 |
|
bartstoppel
Newbie Joined: 23 March 2011 Status: Offline Points: 3 |
Post Options
Thanks(0)
|
thanks everybody for helping.
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |