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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Possible for DBGrid column to have both combobox & texbox?

Status
Not open for further replies.

daughtery

Programmer
Dec 12, 2006
66
US
I have been asked to create a DBGrid which has a third column which has comboboxes for all but the last row. The last row is to have a testbox like cell where the user can enter freeform text. Is this possible? If so, how can it be done?



 

Yes it is possible.

See the Grid's Button property, which makes the cell look like a combo box in a non-drop-down state, and has a click event. Then add a single hidden combo box, and when the button is clicked, position and show the combo. When on the last record, turn off the button.
 
SBerthold

I just posted a a new thread before seen this one.
I am trying to accomplish the same thing.

I have multiple DataGrids which have a one to many relationship with the Main Grid. The other Grids are in tabs on the same form of course.
While editing records in those Child Grids, I wish to display a combo box that looks up values from a table. That way, user won;t have to type in.
Also when user starting populating the starting point DataGrid, I want the two values/Columns, which ever he selects to be carried over to all the other DataGrids. The rest of the other columns on those DataGrid will be ethier a combo box or just a cell and/or a combinision of the two, which ever grid I am on.

Is it possible to accomplish this?

Any sample example that accomplish this will be greatly appreciated.

Thank you

ParyGoal
 
What does "carried over to the other DataGrids" mean? You want to add columns to the child data grids?

Note that DataGrids (ADO) or DBGrids (DAO) are bound controls which means that the columns that they display are governed by the SQL for the recordset that is their data source. Adding columns means recreating the SQL to include new columns.

Another possibility is to use a disconnected recordset as the datasource (ADO only) and add columns to that disconnected recordset.

Can you provide a bit more detail on exactly what you want to do?
 
Hi Golom

Carried over to the other DataGrids means that same values I selected from a combo box to populates the first DataGrid also populate the other DataGrids. There are a total of two columns. EquipmentNumber and its Description.
So if I select 4 equipments, I want those same equipments numbers and thier description to be populated automatically in the other DataGrid. However, if I delete an equipment from the First DataGrid that equipment number should also be deleted from all the other ones as well. Everything has to be in sync.

I am using a ADO recordset to populate the Grids.


I hope I was clear with my question this time.

Thank you

ParyGoal
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top