Home > database >  Turn a treeview node to add 3 question.
Turn a treeview node to add 3 question.

Time:09-26

What do you want to be a level 3 tree structure, when an error in the third grade add node
The first level is the serial number, is the second name, date of the third level is
The time of this code to run an error element not found..

Enclosing graphics.linestyle=1 & amp; & TvwRootLines
This. Style=7 & amp; & TvwTreelinesPlusMinusPictureText
This. ImageList=Thisform. Imagelist1 & amp; & Establish the associated with Imagelist control
Sele xuhao
Replace ALL item number with "B" + ALLTRIM (STR (RECNO ()))
Replace ALL the key with "C" + ALLTRIM (STR (RECNO ()))
Replace ALL key2 with "D" + ALLTRIM (STR (RECNO ()))
Replace ALL key3 with "E" + ALLTRIM (STR (RECNO ()))
Sele xuhao1
Replace ALL item number with "B" + ALLTRIM (STR (RECNO ()))
Replace ALL the key with "C" + ALLTRIM (STR (RECNO ()))
Replace ALL key2 with "D" + ALLTRIM (STR (RECNO ()))
Replace ALL key3 with "E" + ALLTRIM (STR (RECNO ()))




The SELECT xuhao
The SET does ON
GO the TOP
DO the WHILE! EOF ()
& & Add branch node to the only department number field as control Key
This. Nodes. Add (ALLTRIM (xuhao. Item number),;
ALLTRIM (xuhao. The serial number), 1, 2)

* (belong to, child nodes, name, title) node with the number, the name of the child nodes of belong to use node name, department number,

The SELECT xuhao1
The SET does ON
SET the FILTER TO ALLTRIM (xuhao1. Item number)=;
ALLTRIM (xuhao. Item number)
GO the TOP

& & Add department personnel in the node to the only Key field values as the control's Key
DO the WHILE! EOF ()
This. Nodes. The Add (ALLTRIM (xuhao. Item number), 4,;
ALLTRIM (xuhao1. Key), ALLTRIM (xuhao1. Name), 3, 3)
The SKIP





* * * * * the treeview third-level begin to modify this part of the
The SELECT xuhao2
The SET does ON
SET the FILTER TO ALLTRIM (xuhao2 key2)=;
ALLTRIM (xuhao1 key2)
GO the TOP

& & Add department personnel in the node to the only Key field values as the control's Key
DO the WHILE! EOF ()
This. Nodes. The Add (ALLTRIM (xuhao1 key2), 4,;
ALLTRIM (xuhao2 Key3), ALLTRIM (xuhao2. Contact), 3, 3)
The SKIP
ENDDO
* * * * * the treeview third-level end



ENDDO

The SELECT xuhao
The SKIP
ENDDO
The SELECT xuhao1
SET the FILTER TO
GO the TOP
The SELECT xuhao2
GO TOP

CodePudding user response:

The second Key values using ALLTRIM (xuhao1. Key)
But in the third grade with the superior key value is ALLTRIM (xuhao1. Key2)
Key2, as well as the key? Key2 into key good?
  •  Tags:  
  • VFP
  • Related