Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keep grid from going bottom when updating table
Message
From
20/07/2019 17:02:45
 
 
To
18/07/2019 21:15:45
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01669639
Message ID:
01669646
Views:
62
>>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
>>
>>
>HI
>
>Try with
>
>lcAlias = alias()
>select Classlook
>locate
>select (lcAlias)
>
>Koen

And to keep the grid from jumping around, thisform.lockscreen is your friend.

thisform.lockscreen = .t.
*** change values, refresh grid, locate to get the top, etc.
thisform.lockscreen = .f.
Previous
Reply
Map
View

Click here to load this message in the networking platform