Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ListView
Message
From
26/05/2008 06:27:22
 
 
To
25/05/2008 21:54:58
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01319450
Message ID:
01319484
Views:
26
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform