Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem Refreshing Grid on Form
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00680117
Message ID:
00680167
Vues:
21
Thanks Jayesh, I figured that out the painful way...I wish there was a way around it without redefining the grid.
Thanks,
Tracy

>You will need to redefine the grid everytime RecordSource is redefined/re-created.
>
>For example,
>
>Grid1.RecordSource = ""
>SELECT...INTO TABLE myTable
>Grid1.RecordsSource = "myTable"
>Grid1.Column1.ControlSource = "myTable.myColumn1"
>
>
>>I have a grid (grid1) on a form. It's recordsource is a table that is created useing a sql statement in the form's load event. I have set up special column headings and comboboxes as the grid's controls to ease updates.
>>
>>I have an option group that will allow the user to change the records in the grid (by issuing a new select statement).
>>
>>When the form loads, the grid is populated as it should be and udpates occur as they should.
>>
>>However, when the user clicks on any of the options in the option group to change the select statement, the grid is repopulated as it should be, but it also goes to a 'generic' grid that does not contain my column headings, special controls in each column, etc. Why is this happening? Any ideas are greatly appreciated!
>>
>>Here is the initial population of the grid in the form's load that works correctly (grid is displayed correctly with appropriate controls, etc and update works):
>>
>>
>>*Form Load
>>SELECT cn_name, cn_port, cn_printer FROM lcontrol ;
>>  WHERE lcontrol.cn_name IN ;
>>       (SELECT ctrlname FROM ctrlset WHERE UPPER(ALLTRIM(ctrlset.ctrlname))="CONTRACT");
>>       INTO TABLE (hdir+"TEMPLCONTROL.DBF")
>>
>>
>>Here is the code in one of the options of the option group that populates the grid and the table has the correct records, but the grid is now a generic grid and not the one on the form I customized:
>>
>>
>>*option 1 of option group
>>USE IN templcontrol
>>SELE 0
>>SELECT cn_name, cn_port, cn_printer FROM lcontrol ;
>>  WHERE UPPER(ALLTRIM(lcontrol.cn_name))="RECEIPT" ;
>>  INTO TABLE (hdir+"TEMPLCONTROL.DBF")
>>SELE TEMPLCONTROL
>>PRIVATE lSuccess
>>lSuccess=CURSORSETPROP("Buffering", 5, "TEMPLCONTROL")
>>IF lSuccess != .T.
>>   =MESSAGEBOX("ERROR! Could not set buffering mode on temporary table!",0,"Please exit this form and try again.")
>>ENDIF
>>THISFORM.GRID1.RECORDSOURCE=""
>>THISFORM.GRID1.RECORDSOURCE='TEMPLCONTROL'
>>THISFORM.GRID1.REFRESH()
>>
>>
>>Thanks all for your help!
>>Tracy
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform