Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with treeview

Status
Not open for further replies.

mimosa

IS-IT--Management
Apr 4, 2002
25
US
I have a treeview, I'd like to add and delete nodes from there, so I create 2 forms, the 1st one has a treeview and a grid, the 2nd was called by add command in the 1st form.
This code is in Builtreeview method:
#Define tvwFirst 0
#Define tvwLast 1
#Define tvwNext 2
#Define tvwPrevious 3
#Define tvwChild 4
LParameters toNode
local xitem
Thisform.oleTreeView.Nodes.Clear
select tree
set order to xitem
Go top
Do while !eof()
If tree.item=space(6)
x = ThisForm.oleTreeView.Nodes.Add,,alltrim (tree.sitem),alltrim(tree.nom))
Else
x = ThisForm.oleTreeView.Nodes.Add(alltrim(tree.item),tvwChild,alltrim(tree.sitem),alltrim(tree.nom))&&& in this ligne also is displayed error to tell me :"Code d'exception OLE IDispatch 0 de nodes:Key in not unique in collection"
Endif
Select tree
Skip
Enddo
Thisform.lExpanded = .F.
* sets the selected node to the first one in the collection
Thisform.oleTreeView.SelectedItem=
ThisForm.oleTreeView.Nodes(1)&&& msg error is displayed:"Coded'exception OLE IDispatch 0 de nodes: Key is not unique in collection"
* displayes the selected node's properties
Thisform.UpdateProperties(ThisForm.oleTreeView.SelectedItem)
Q:How can I correct is mistake?(Alias Tree:(item,nom,sitem,profil)eg:("",Menu,P1,Master),("",Menu,P1,Agent))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top