Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Question
Message
 
À
19/01/2001 10:09:40
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00465700
Message ID:
00465733
Vues:
11
>Hello All,
>
>I expect this question has already been asked a few times before...
>
>I have a grid baseclass in which I cycle through each column and .Addobject() a combobox to certain columns.
>
>The RowSource of this ComboBox is a SQL Statement which relates to the particular row on the grid.
>
>e.g.
>

>.cboGridCombo.RowSource = ;
>"Select * From destinations Where destinations.receiver = gridalias.receiver"
>.cboGridCombo.RowSourceType = 3
>

>
>I haven't really done the code for this yet, so really I am asking am I wasting my time? will this work? Will each seperate row in the grid have a seperate set of combobox contents?
>
>Thanks in Advance
>
>Will

Hi Will,

I tried it and it works.

You need to add "INTO CURSOR myColumnXComboSource" to your SQL:
"Select * From destinations Where destinations.receiver = gridalias.receiver INTO CURSOR myColumnXComboSource"

You will need to add to your Grid.AfterRowcolChange():

this.column5.combo1.Requery() && assuming that the combo is in column 5
this.column5.combo1.Refresh()
this.column5.combo1.ListIndex = 1 && so you see the first combo item right away.

You might need to change this sample code as you adding the combos on the fly and I don't know if they always supposed to be in the same columns.
Nick Neklioudov
Universal Thread Consultant
3 times Microsoft MVP - Visual FoxPro

"I have not failed. I've just found 10,000 ways that don't work." - Thomas Edison
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform