Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Grid checkbox & drop down

Status
Not open for further replies.
Sep 17, 2001
672
0
0
US
I need to know how to insert a check box for each line in a grid. I also need to be able to create a combo box in certain fields. So...
First column: Checkbox
2nd column: Name
3rd column: Type (select box with values popped from query)
etc.

So I query name from Database then put into cursor and set recordsource of grid to this cursor. Now how would I add the check and select boxes?
 
To add any control to a grid, first select the grid. Right-click and select "Edit" (or just control-click on the grid if you have VFP 7 or later). This will drill into the grid. Now select the desired control (such as a checkbox) from the Form Controls toolbar, and then click on the column you want it in. You won't see anything at first, but if you then go to the Property sheet for that grid and scroll down to the column you clicked on, you'll see that the column now contains a Header, a TextBox and also the control you just added. From the prop sheet, select the column, and go to the CurrentControl property. Set it to your checkbox instead of the Textbox.

The only thing left is to set the Sparse property. By default, VFP will only display non-textbox controls in grids when they have focus. If you want the controls to display all the time, change that column's Sparse property to .F.

Hope that helps!

-- Ed
-- Get great VFP support in a forum filled with Microsoft MVPs!
--
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top