Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Can't assign the controlsource of a grid column anymore
Message
De
04/09/1998 11:07:44
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
04/09/1998 10:21:20
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00132988
Message ID:
00133325
Vues:
14
Sylvain,
Have I sent you grids.vcx or I mess up names ? If I sent in that multiselect grid + myheader.prg has code to save and restore format properties. Lemme know.
Cetin
>Thank you very much Cetin, your solution is a step in the right direction. I'm not over the problem yet, now I do not have any error message and the grid display the right data, but the heading are lost and the left column is halfway off the grid display.
>
>The next thing I will test, is to generate the grid itself programmatically after doing the SELECT-SQL and erase it before it.
>
>My SQL is not static, not only the WHEN clause vary because of what conditions the user selected, but the joined tables also.
>
>Thanks again.
>
>>As I read this is a matter of SQL changing grid format.
>>
WITH THISFORM.pgfValid.pagListe.grdListe
>>* Save column names
>>   dimension aColNames[.columncount]
>>   local ix
>>   for ix = 1 to .columncount
>>       aColNames[ix] = .columns(ix).name
>>   endfor
>>   .RecordSource = ""
>>* Do whatever you do to change grid cursor here - ie:SQL
>>   .RecordSource = "TempListe"
>>* Restore column names
>>   for ix = 1 to min(.columncount,alen(aColNames))
>>       .columns(ix).name = aColNames[ix]
>>   endfor
>>* Be sure columncount and/or len(aColNames) is enough to restore them all
>>   .colListe.ControlSource = "TempListe.cLiNom"
>>   .colDate.ControlSource = "TempListe.dAppel"
>>   .colTel.ControlSource = "TempListe.cTel"
>>   .colPrenom.ControlSource = "TempListe.cCustomerName"
>>   .colRespCode.ControlSource = "TempListe.cCodeRep"
>>   .colAgentNb.ControlSource = "TempListe.cNoAgent"
>>ENDWITH
BTW if your SQL is static (SQL doesn't change but only data), directly setting recordsource to SQL and recsourcetype to SQL, grid.refresh is enough.
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform