>Hi all
>I'am testing the Multiselect Grid class made by Cetin
>and i got a problem
>In the Init event of my form I try to do this
>Thisform.MultiGrid.csql="Pnum,Pnom from Produit Order By Pnum"
>When the form show my Multigrid is affected with the value of a another table open in the data environement.
>
>C'an i change the value of the csql propertie on the fly ?
>I'm sure the class work fine but I'm not sure of me using the class
>
>Thank's
>Ben.
Martineau,
You could change it on the fly. If you drop any grid on form during design and assign no recordsource (cSQL for multiselect) grid populates itself with the alias currently selected. It's a VFP behaviour. If you want to do it in init of form (could be done anywhere) :
with ThisForm.Multiselectgrid1
.cSQL = "Pnum,Pnom from Produit Order By Pnum"
.cOrgSource = "produit"
.init()
endwith
Grid would pull captions from DBC in case it's not a free table. If you want to change captions manually, either use "myHeader1" or alternatively control's index :
ThisForm.Multiselectgrid1.Columns(1).Controls(1).Caption = "myCaption"
Header is always the first control of a column.
PS: If you prepare how would grid look during design (including columncount, captions, caption fonts, columnwidths etc) then do not forget to set lKeepFormat property to .t.
Cetin