Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How does one put a drop down into a grid field?
Message
From
06/02/2002 02:42:55
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00615864
Message ID:
00615892
Views:
23
>I've been playing with grids today and had two questions. First of all I want to try and fit about twenty fields into the grid. One of the fields is a 100 character field all of which needs to be displayed. Is there a way to have the thing show two lines of 50 characters each and have the text wrap? Secondly I was wondering how I can put a drop down field into one of the grid fields.
>
>Thanks,
>
>Nancy

Nancy,
You can use any type of control in a grid besides textboxes. They could be editboxes, containers having multiple other objects, other grids and so on. Only difference it's harder to control them in a grid.
1) Instead of textbox use an editbox. Editbox has wordwrap built-in and rowheight sets its height.
Also a grid might be used in 'change' style instead of default 'browse-browse' where fields show from top to bottom.

2) As said you can put many different of controls in grid. To add a new control to column :
-Right click grid and select edit.
-Click on your target column to make that the active one (not needed actually)
-Select the control you want - say from controls toolbar
-Click on the column
-In PEM sheet you'll see the new control's name -Combo1
-Select the column from PEM sheet's dropdown
-Set 'Currentcontrol' property to 'Combo1'
-Sparse to .f. (If you want all rows to show new control at all times)

Same thing with editbox.

This is routine way of adding a new control to grid. But generally controls like combos need some properties set and probably code written. It's harder to do once combo is in grid.
If it's from a class procedure is like the above one (you could drag from a classlib). If not I suggest first you place a como on form, set its properties and code, when done Ctrl+C (or X), select your grid for editing and paste to target column. Continue with next steps (currentcontrol and sparse).
Cetin
Ç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