Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Putting a Combobox in a grid
Message
From
22/07/2000 18:19:21
 
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00395897
Message ID:
00395907
Views:
10
It's telling me that I can't have nested classes in methods. Where else do I write the class? Here's my code so far:

Thisform.AddObject('Combo1','GridCombo')

DEFINE CLASS GridCombo AS COMBOBOX
RowSourceType = 1
RowSource = 'Loan,Purchase,Missing'

ENDDEFINE

Where do I put it?

>>If I just addobject('myobjectname', 'classname') and change currentcontrol to myobjectname, shouldn't I :
>>
>>1. be able to do that, and.......
>
>You can, but if you don't set any properties for the ComboBox to tell it at least the RowSource and RowSourceType, specify that the Sparse property is true, define the columns properly, it will not do anything. Dropping a control that requires configuration in a column doesn't do anything for you.
>
>>2. get a standard form of whatever classname I entered in addobject?
>>
>
>Yep, you can drop an instance of any object class, either a VFP basclass or one from your own class libraries, in there, but it won't configure it. It doesn't know what behaviors to use, or any of the things that would require non-default values to be set. IOW, AddObject() places the control there, but doesn't tell it how to act. You still have to do that.
>
>>
>>
>>>>How do you replace the textbox control with a combobox control for the column of a grid?
>>>>
>>>
>>>Use the Column's AddObject() method to add an instance of a ComboBox control, set the properties of the ComboBox, and then set the Column's CurrentControl property to select the ComboBox control you've added.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform