General information
Category:
Forms & Form designer
Environment versions
Network:
Windows 2000 Server
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only