Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Text field in grid
Message
From
24/05/2001 10:41:15
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
24/05/2001 10:01:13
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00510848
Message ID:
00510907
Views:
11
Will,
Let your baseclass code run with a dummy controlsource first (ie: prod_type), then change its properties.
*grid.init
dodefault()
for each oColumn in this.Columns
if upper(oColumn.ControlSource) = this.Recordsource+'.PROD_TYPE'
 oColumn.Header1.Caption = 'Product Type'
 oColumn.Text1.Controlsource = '(iif(...))'
 exit
endwith
endfor

*Or instead of iif
oColumn.Addobject('myCombo','Combobox')
with oColumn.myCombo
.Additem('Intl')
.Additem('Def')
endwith
oColumn.Currentcontrol = 'myCombo'
oColumn.sparse = .f.
Fox2x style format still exists with 'M' format property but I don't think it would be suitable.
Cetin

>Hi Marcia/Cetin,
>
>Yes prod_type is a field in the table
>Setting the columns controlsource works - only problem is that my grid baseclass looks to the columns controlsource to get the column heading from my data dictionary. :(
>
>Is there any other way of doing something like this.. the field is readonly so I don't want to use a Combo, but this is basically the effect I want.. a combo with a column bound to a data source.
>
>the old 2.x spinner format (where you give it a list of items and you can press space to cycle through them) does that still exist and would it be suitable?
>
>Last resort.. I could create another column with the text data I want to display.
>
>Any suggestions?
>
>TIA
>
>W(no h!)ill
>
>>Hi Whil.
>>
>>>>the browse command was as follows
>>
>>disp_type = IIF(prod_type=1, "Intl", IIF(prod_type=2,"Ded",""))
>>
>>
>>nothing special.. but how do I do the same thing in a grid's textbox? <<
>>
>>Put this in the controlSource for the column:
>>
>>( IIF(prod_type=1, "Intl", IIF(prod_type=2,"Ded","")) )
>>
>>I am assuming that prod_type is a field in the table you are using for the grid's RecordSource.
>>
>>Marcia
Ç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
Previous
Reply
Map
View

Click here to load this message in the networking platform