Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The problem about seek nodes in treeview
Message
De
08/09/2002 23:07:36
 
 
À
08/09/2002 22:48:39
Eugene Kolmakov
Millennium Technologies
Vladivostok, Russie
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Divers
Thread ID:
00698114
Message ID:
00698126
Vues:
18
Hi, Eugene,
I've tried your way, but in next nodes.add method something wrong about the index out of bound. The problem seems the first nodes.add not works. The loNewNode got null value from the nodes.add method. It's very strange. Thanks for your help anyway.
loOleTree=This.Parent.Treeview
loOleTree.imagelist = Thisform.ImagesList.Object
loOleTree.Nodes.Clear
If !Empty(lsBR)
	Select Cate2Class.Category_ID,Category_Name,Class_Name,Class2BRand.Class_ID;
		From Categories,Cate2Class,Classes,Class2BRand,Brands;
		WHERE Alltrim(Cate2Class.Category_ID)==Alltrim(Categories.Category_ID) And Alltrim(Cate2Class.Class_ID)==Alltrim(Classes.Class_ID);
		AND Alltrim(Class2Brand.Class_ID)==Alltrim(Cate2Class.Class_ID) And Alltrim(Class2Brand.Brand_ID)==Alltrim(Brands.Brand_ID) And Alltrim(Brand_Name)==Alltrim(lsBR) ;
		ORDER BY Cate2Class.Category_ID, Cate2Class.Class_ID;
		INTO Cursor lcrTMP
	If _Tally!=0
		Select lcrTMP
		lsCT=""
		Scan All
			IF ALLTRIM(Category_ID)!=ALLTRIM(lsCT)
				loNode=loOleTree.Nodes.Add(,2, Category_ID, Category_Name,"CloseBook","OpenBook")
			ENDIF
			lsCT=Alltrim(Category_ID)  **Error From Here, Error Code 1429:OLE IDispatch exception code from Nodes: Index out of Bound
**And if I add a suspend before last code, I can see the loNode Value is .F. And type is logical, That means the loNode didn't get the Index from last Nodes.add method
			loOleTree.Expand(loNode)
			loOleTree.Nodes.Add(loNode,4,Class_ID,Class_Name,"CloseBook","OpenBook")
		Endscan
		Use
	Endif
Endif
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform