8/29/2025 7:30:28 AM
|
|
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!
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.
|
|
|
|
Programmatically expanding a Treeview branch
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 |
|
|
| |
|
Re: Programmatically expanding a Treeview branch
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. |
|
|
| |
| |
|
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!
|
|
|
|
|
|
|
|