Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
A Good Grid
Message
De
24/12/2001 16:54:02
 
 
À
24/12/2001 16:06:02
John Marrone
Bloodstock Research Inc.
Lexington, Kentucky, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Titre:
Divers
Thread ID:
00597988
Message ID:
00597997
Vues:
18
Hi jOHN.

>> Does anybody know of a good grid, 3rd party that will let you sort by
clicking on the header, and sort either way. I used true DBGrid with VB
and found it to be very nice. Is there something for vfp avilable somewhere. <<

You do not need a third party control to do this. All you need to do is have this code in the header's click methos:
WITH This.Parent
  IF PEMSTATUS( .Parent, 'SetOrder', 5 )
    .Parent.SetOrder( JUSTEXT( .ControlSource ) )
  ENDIF
ENDWITH		
This code in the grid's SetOrder() method:
LPARAMETERS tcTag
LOCAL lnRecNo, laTags[ 1 ]
*** Make sure a valid tag name was passed
IF ! EMPTY( tcTag )
  *** Make sure we have the procedure file loaded so we can access the
  *** IsTag() function
  SET PROCEDURE TO Ch06 ADDITIVE
  WITH This
    *** Make sure it really is a tag for the grid's RecordSource
    *** Get all open indexes for the specified table
    ATagInfo( laTags, "", .RecordSource )
    IF ASCAN( laTags, tcTag, -1, -1, 1, 7 ) > 0 
      lnRecNo = RECNO( .RecordSource )
      *** Go ahead and set the order for the table
      SELECT ( .RecordSource )
      SET ORDER TO ( tcTag )
      IF lnRecNo # 0
        GO lnRecNo IN ( .RecordSource )
      ENDIF
      .SetFocus()
    ENDIF
  ENDWITH					
ENDIF

Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform