Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Keep grid from going bottom when updating table
Message
De
19/07/2019 21:34:22
 
 
À
18/07/2019 17:59:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01669639
Message ID:
01669643
Vues:
82
>Hey all
>
>So, I've got a grid, RecordSource = the cursor resulting from a MSSQL proc.
>
>If the user checks a box and fills in a date, I update the cursor, clearing/resetting RecordSource and redisplay on form for any editing.
>
>Everything works except that the record that shows in the grid is the last record of the cursor and you have to scroll up for the rest of the records.
>Grid Creation (which shows correctly)
>
>  With Thisform.grdLookup
>    .RecordSource = 'ClassLook'
>    .Width = 735
>    .Visible = .T.
>    .ColumnCount = 8
>    .column1.header1.Caption = 'Change'
>    .column1.ToolTipText = "Acceptible Values are 'C','E', 'F','I','M','S' "
>    .column1.Width = 50
>    .column1.ReadOnly = .F.
>    .column1.Format = "!"
>    .column2.header1.Caption = 'Status'
>    .column2.Width = 75
>    .column3.header1.Caption = 'Last Name'
>    .column3.Width = 150
>    .column4.header1.Caption = 'First Name'
>    .column4.Width = 150
>    .column5.header1.Caption = 'Grade'
>    .column5.Width = 50
>    .column5.ReadOnly = .F.
>    .column6.header1.Caption = 'CSTSID'
>    .column6.width = 75
>    .column7.header1.Caption = 'Paid'
>    .column7.Width = 50
>    .column7.ReadOnly = .F.
>    .column8.header1.Caption = 'Paid Date'
>    .column8.Width = 75
>    .column8.ReadOnly = .F.
>  Endwith
>
>
>Cursor Update
>
>mPayDate = Thisform.txtPaidDt.Value
>
>update ClassLook SET Paid = 'Y', PaidDate = mPayDate
>GO top
>
>  With Thisform.grdLookup
>    .RecordSource = ''
>    .RecordSource = 'ClassLook'
>  ENDWITH
>
>
You don't have to reset the RecordSource to show the changes in the cursor. just:
Thisform.grdLookup.Refresh()
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform