Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid changes record pointer
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01409326
Message ID:
01409395
Vues:
40
I noticed you call refresh before setting the order. Is the got focus supose to refresh thew dislay for the sort selected? My setfocus does not do that (there is no code in grid, column, header or textbox setfocus). Without the refresh after set order the data does not redisplay in the correct order. Look at my 2nd or 3rd response for my header.click code.

>I have code to capture the record number in the BeforeRowColChange to a form property. In 9 of 12 column headers have code to set the order of the data to that field. At the end of the header code it goes to the record variable if it is not equal to the recno. Can anyone tell me why the record pointer jumps around?
>
>Here is the code I use to sort the grid when the user clicks on the header and it works flawlessly. It is called from the header's click() method:
>
>
>IF NOT EMPTY( This.cSortField  )
>  *** There seems to be a refresh issue here
>  *** because even though the data is in the cursor
>  *** it is not showing up in the grid after the sort
>  *** and it looks like it is related to AllowCellSelection being .F.
>  This.AllowCellSelection = .F.
>  This.Refresh()
>  KEYBOARD '{CTRL+TAB}'
>  
>  lnRecNo = RECNO( This.RecordSource )
>  *** Go ahead and set the order for the table
>  SELECT ( This.RecordSource )
>  IF NOT EMPTY( This.cSortOrder )
>    SET ORDER TO ( This.cSortField ) DESCENDING 
>  ELSE
>    SET ORDER TO ( This.cSortField ) 
>  ENDIF
>  This.SetFocus()
>  IF lnRecNo # 0
>    GO lnRecNo IN ( This.RecordSource )
>  ENDIF
>ENDIF
>
Extreme Programming = Plan -> Design -> Code -> Test
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform