Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Question
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00965310
Message ID:
00965379
Views:
10
I ´ve downloaded a grid's class from Portalfox (Luis María Guayan was its author) which has two methods.
1) PreservarColumnas()-which keeps all grid's properties
2-RestaurarColumnas() restores all grid's properties.

Before you perform the select statement run method PreservarColumnas and after run RestaurarColumnas, it would be beteer for you to create a class and include the two methods in it, otherwise you must create the methods in the form.

hth

*-- Grid::PreservarColumnas
LOCAL lo
FOR EACH lo IN THIS.COLUMNS
STORE lo.CONTROLSOURCE TO ("lo."+lo.CURRENTCONTROL+".Tag")
ENDF
THIS.TAG = THIS.RECORDSOURCE
THIS.RECORDSOURCE=""

*-- Grid::RestaurarColumnas
LPARAMETERS lcAlias && si no está en la grilla debe especificarse acá
LOCAL lo, lc
THIS.RECORDSOURCE = IIF(NOT EMPTY(lcAlias),lcAlias,THIS.TAG)
FOR EACH lo IN THIS.COLUMNS
lc = EVAL("lo."+lo.CURRENTCONTROL+".Tag")
IF NOT EMPTY(lc)
IF NOT '.'$lc && sin alias asignado: lo asigna ahora
lc = THIS.RECORDSOURCE+'.'+lc
ENDIF
lo.CONTROLSOURCE = lc
ENDIF
ENDFOR

>I have a grid that uses a cursor name as the RecordSource and RecordSourceType = 1. I use the builder to setup the look and feel of the grid in the designer. When I fire up the form, it looks great with all my custom column heading and width the first time. However, once I use a SELECT statement to update my cursor, all the formating were gone and the column headings became the field names. What can I do to prevent that?
>
>Thank you
Previous
Reply
Map
View

Click here to load this message in the networking platform