Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Jump to a specific node in a treeview and expand it
Message
From
22/10/2003 18:18:29
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Jump to a specific node in a treeview and expand it
Miscellaneous
Thread ID:
00841352
Message ID:
00841352
Views:
65
If my treeview's node.text = "1MHG" and the node.key= < some specific key > , how do I programmatically jump to that node in the treeview, select it, and expand it?

Here is where I populate the treeview. Ideally, I would go ahead and expand the 1MHG node when it is created below:
THIS.oletreeview.nodes.clear()
WITH THIS.oletreeview.nodes
	.ADD(,tvwFirst,'File_Name'+'_'+'0000',thisform.Al3_file)
	.ADD('File_Name'+'_'+'0000',tvwChild,'Message1'+'_'+'0000','Message(1)')
	SELE Al3Parnt
	SET ORDER TO 0
	SCAN
		DO CASE
		CASE Al3Parnt.cself = "1MHG"			&& message header
			.ADD('Message1'+'_'+'0000',tvwChild,al3parnt.ckey,TRIM(al3Parnt.cSelf))
                        *Now expand the 1MHG Node somehow
		CASE Al3Parnt.cself = "2TRG"			&& new transaction
			.ADD('Message1'+'_'+'0000',tvwChild,'2TRG'+'_'+SEQ,'Transaction('+ALLTRIM(STR(al3Parnt.ntran))+')')
		CASE Al3Parnt.cself = "3MTG"			&& message Trailer
			.ADD('Message1'+'_'+'0000',tvwChild,al3parnt.ckey,LEFT(TRIM(al3Parnt.cSelf),4))
		CASE Al3Parnt.cPARENT = "A0"          &&  this record's parent 'branch' A0 is always top level branch
			.ADD('2TRG'+'_'+SEQ,tvwChild,al3parnt.ckey,TRIM(Al3Parnt.label))
		OTHERWISE
			.ADD(Al3Parnt.cp_id, tvwChild, ;
				al3Parnt.ckey,TRIM(Al3Parnt.label))
		ENDCASE
	ENDSCAN
ENDWITH
TIA,
Tracy
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Next
Reply
Map
View

Click here to load this message in the networking platform