Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid: how do I change a column from txt to combo?
Message
From
17/11/2006 01:07:44
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
16/11/2006 22:49:01
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 6 SP5
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01170582
Message ID:
01170594
Views:
18
>I'm real new to VFP, so bear with me :)
>
>I added a 6 column grid to a form. All 6 columns defaulted to textbox objects. I want to change the 1st column to be a combobox that pulls values from a lookup table. If user select a choice from combobox, I want to save that value to a field in the child table associated with grid...
>
>I assume I would only want a combobox in the column, not in addition to a textbox, right?
>
>So much to learn :)

Just drop the combo from the toolbar, project manager or class browser on the column. Then in the PEM window, select the textbox in that column (you should see that the column now has header, textbox and combo). Now click the title bar of the editing window (not anything in the window, just the title bar), and press Delete. This should delete the textbox and leave you with just the combo. It'd also be a good idea to set .currentcontrol="combobox1" (or whatever the combo's name is).

You could do this much easier with a builder, though - less chance of screwing up. Something like this:

Click on the grid so it's selected. Now in command window:
set classlib to mylib.vcx    && where your combo is - if it's a base combo, skip this
aselobj(a)
oGrid=a[1]
oCol=oGrid.column1
oCol.addobject("cboMyCombo", "mycombo")  && or just plain base combobox
oCol.RemoveObject("text1")
oCol.currentcontrol="cboMyCombo"
That's your builder :).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform