Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Header problem
Message
 
 
To
25/07/2011 22:11:29
Yim Ming Sun Derek
Spacious Design Consultant
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01519130
Message ID:
01519131
Views:
37
>Hi,
>
>I have a grid on a form and set the column header to BOLD, the caption is Customer Code, Customer Name.
>I have some code in click event on the column header, but after run the select statement, it reset all the setting of the grid,
>the header change to the cursor field name, not bold, the header click event reset to none.
>
>why ?
>
>the code as follow:-
>
>
>SELECT cusmas->cusno,cusmas->cusname FROM cusmas  INTO CURSOR cusmas_srh ORDER BY cusmas->cusno
>SELECT cusmas_srh
>GO top
>thisform.grdClient.RecordSource="cusmas_srh"
>thisform.grdClient.Refresh()
>thisform.grdClient.COLUMN1.SetFocus() 
>
>
>Please advise.
>Thank
>Derek

You're running into known 'grid restoration' problem. There are two common ways to avoid it.
1. Safe Select approach - google on 'Andy Kramek Safe Select'

2. Reset grid's RecordSource to empty string before running SQL statement.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform