Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, August 29, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Programmatically expanding a Treeview branch
Brian Kempe
Posts: 53
 
Programmatically expanding a Treeview branchYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 31 Jan 07 12:01 PM
fiogf49gjkf0d
Lets say Ive got a tree view like this:
__________________________
Set objNode0 = TreeView.Nodes.Add(Nothing,"Account Name") 'This is the where the first level of the tree is created.
objNode0.tag = objrs.fields("accountid").value &""
with objrs
while not (.eof or .bof)
set objNode = TreeView.Nodes.AddChild(objNode0, objRS.Fields("Account").Value & "") 'This then populates the values under the specified node
.MoveNext
Wend
_______________________
And I wish to return from a dataform and refresh the tree view to display a new line I entered into the treeview via the dataform, BUT, when when I refresh the treeview I want the branch I was on to expand open again.

Kinda like this( although I know this code is incorrect):
_________________________
Set objNode0 = TreeView.Nodes.Add(Nothing,"Account Name") 'This is the where the first level of the tree is created.
objNode0.tag = objrs.fields("accountid").value &""
with objrs
while not (.eof or .bof)
set objNode = TreeView.Nodes.AddChild(objNode0, objRS.Fields("Account").Value & "") 'This then populates the values under the specified node
???? if objnode0=strSavedPlaceNodeTag then objNode0.Selected=True ????
.MoveNext
Wend
___________________________
In the above example I am accessing an edit field called strSavedPlaceNodeTag where I store the past info I also have one called strSavedPlaceNodeText.
Any Ideas
[Reply][Quote]
Brian Kempe
Posts: 53
 
Re: Programmatically expanding a Treeview branchYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 01 Feb 07 11:25 AM
fiogf49gjkf0d
Help Please !!!!!!!!
[Reply][Quote]
John H. Hedges
Posts: 62
 
Re: Programmatically expanding a Treeview branchYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Feb 07 1:01 AM
fiogf49gjkf0d
Here's how I do it: When you create the new node, do it this-a-way:

Set MyNewNode = tvTree.Nodes.Add(Nothing, "This is the caption")
iNodeIndex = MyNewNode.AbsoluteIndex

Then, once your form closes and assuming nothing else gets inserted into the TreeView in the meantime, you can expand the node like this:

tvTree.Nodes.Item(iNodeIndex).Expand True

As far as using the .Tag property for tree nodes goes, what version of SLX is this? I gave up on both that and the .Data property with 6.2.3 - I simply couldn't get them to work at all - but if it works in 7.x, I'd be obliged to hear tell of it.
[Reply][Quote]
Brian Kempe
Posts: 53
 
Re: Programmatically expanding a Treeview branchYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Feb 07 11:30 AM
fiogf49gjkf0d
Thank you
[Reply][Quote]
alexUA
Posts: 23
 
Re: Programmatically expanding a Treeview branchYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Jul 09 6:15 AM
Hi! Thank you! But I need to have my TreeView object in the same state after I'll do refresh. In your code i can open only upper level branch who have childs.
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/29/2025 8:21:50 AM