Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ListView
Message
De
26/05/2008 06:27:22
 
 
À
25/05/2008 21:54:58
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Divers
Thread ID:
01319450
Message ID:
01319484
Vues:
27
How to display above data in ListView?

This code in the form's Init():
#DEFINE lvwColumnLeft	0	&& Left
#DEFINE lvwColumnRight	1	&& Right
#DEFINE lvwColumnCenter	2	&& Center

LOCAL llretVal 
llRetVal = DODEFAULT()
IF llRetVal
  WITH Thisform.oListView
    *** Set up the icons to indicate Sort Order when you click on the column header
    .ColumnHeaderIcons = ThisForm.oHeaderIcons  && this was set visually using the designer
    *** Must Add the Column Headers for all the fields we are going to display
    WITH .ColumnHeaders 
      .Add( , , 'Code', 250, lvwColumnLeft )
      .Add( , , 'Party', 250, lvwColumnLeft )
      .Add( , , 'Quantity', 250, lvwColumnLeft )
    ENDWITH
    WITH .ListItems 
      *** Populate the sample listView with the records in the table
      SELECT Table1
      SCAN
        *** Add the ListItem for this Record
	loItem = .Add( , ALLTRIM( TRANSFORM( Table1.Code ) ), TRANSFORM( Table1.Code) )
	*** Use fields 2 - n to populate the list's SubItems
	*** If we are in report view
        IF Thisform.oListView.View = 3  && lvwReport 
          WITH loItem
            .SubItems( 1 ) = ALLTRIM( Table1.Party )
            .SubItems( 2 ) = TRANSFORM( Table1.Qty )
          ENDWITH
        ENDIF
      ENDSCAN
    ENDWITH		
  ENDWITH
ENDIF

RETURN llretVal
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform