ControlsEx : index of the node

specci48

Well-Known Member
Licensed User
Longtime User
The treeview knows it!
B4X:
node1.Value = treeview.SelectedNode


specci48
 

specci48

Well-Known Member
Licensed User
Longtime User
You need this:
B4X:
Sub tree1_AfterSelect
      node1.Value = tree1.SelectedNode
      Msgbox([B]node1[COLOR="Red"].Text[/COLOR][/B])
End Sub


specci48
 
Thank you for your help , but i'm talking about node's index not the text property :)
I've been mucking with it the whole day and now I'm thinking about something like
index = StrAt(node1.Text,3).Well... it's a drag.
It seems to me that it's impossible in Basic4ppc to get the index of the selected
node. :(
 
I'm trying to do an app similar to Basic4ppc help file.When a node is selected
a form with a multiline textbox is shown.

Sub tv.AfterSelect
Node.Value = NodeN.index 'wish such expression was available :)
index = Node.Value
FormRecords.Show
TextBoxRecords.Text = Table1.Cell("content",index-1)
'Table1 is in the *.lit file.

I think I can find a way to do it without getting a node's index.
Best Regards.
 

specci48

Well-Known Member
Licensed User
Longtime User
I had a similar problem with my ToDoTree application.
My workaround was to "misuse" the selectedImageIndex, storing a value that I need to save and load the data for this node.

E.g.:
B4X:
node1.value = tree1.AddNewNode("something")
node1.selectedImageIndex = 'rowOfTable for this node'
...
...
...
node2.value = tree1.selectedNode
rowOfTableForSelectedNode = node2.selectedImageIndex
Maybe tis solution works for you (if you don't need separate imgages for your nodes).


specci48
 
Top