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

listbox in a grid

Status
Not open for further replies.

mikeisvfp

Programmer
Mar 5, 2011
91
CA
Is there a way to have the listbox dropdown as a list in a grid?

I have a form with the listbox that the user can add dental procedures to once the user saves,once saved the data is then displayed on the grid. But because dental procedures can be more than 1, I would like for a list box to drop down in the grid.



 
Sounds like of a mess of an interface, but let's clear up some terminology.

When you say "drop down" we immediately think of a combobox that has drop down capability built into it and yes, you can have a combo box inside a grid.

What have you tried and what didn't work?
 
Yes combobox is exactly what i thought you would suggest, now in the form i didnt think adding dental procedures to a combobox was a much better looking interface, but maybe if i use the listbox in the form and the combobox in the grid?
Havent tried this yet but will this work?
 
You haven't asked anything specific enough for a yes or no.

If a combobox wasn't what you wanted, what other kind of "drop down" did you have in mind?

Lists (and combos) are *usually* used to display a fixed list of values with (usually) a single item selected. It sounds like you want them to do several different things, including accepting input (which lists can't, but combos can).

I still have no idea what you're trying to accomplish. Sorry.
 
Ok, All i really want is for whatever dental procedures i put in the listbox of my form to be displayed in my grid. now i dont want the dropdown to happen as soon as the grid is displayed, i want the dropdown to happen once the user clicks on the actual dropdown in the grid.
 
The dropdown in the grid is going to show the stored dental procedures. the dropdown is for viewing pruposes only.
 
What you've described so far can be done but I say that with the caveat that you have a tendency to under explain what you're after. k?

Now what do you need help with?

* Getting the combobox into the grid?
* Populating the combobox?

I should warn you that this is not an exercise for the inexperienced or the faint of heart. You will likely lose hair over it.
 
lol I have problems with niether one * Getting the combobox into the grid* Populating the combobox

My problem is when i click on the combobox nothing happens, the dropdown does not drop although there are items to be displayed in that combobox.

Also in the form that i mentioned in which i input the data into in order for the info to be displayed on the grid, should i use a listbox or what do you suggest?
 
Have you perhaps simply set the grid to AllowCellSelection = .F. or ReadOnly = .T.?

Bye, Olaf.
 
AllowCellSelection is .T. and ReadOnly is .F.

still same behavior
 
Hm, as the list of the combobox does not drop, that suggests there are indeed no items in it. I don't really see another possibility, unless you set the combobox itself readonly or disabled.

How did you add the combobox? Via code? Addobject()?

Bye, Olaf.
 
but there are items in there, when i change the CurrentControl
back to text i see the very first item displayed.

I added the combobox to the grid by right clicking on the grid
edit, and brought the combobox over to the column of choice, which in this case would be the procedure column.
 
Its ok Olaf, I think Im going to change the view of my grid
anyways, Ive been thinking this through maybe what ill do is
in my right click menu ill have a selection called
"View Procedure" and that will bring up a form with all the procedures listed.

Much easier...



thanks for the help guys
 
the dropdown is for viewing purposes only.

I might suggest that you might be going about things wrong.

The reason to put a combobox in a Grid it to allow users to change values in the records from among the various Combobox values.

Viewing only is looking at the existing settings - not being able to change them. And a Grid Textbox (ReadOnly) works best for that.

If you want to show multiple dental procedures for which an individual patient has had, then you would be better off using 2 separate data tables (1 patient info & 1 procedures they have had) which are RELATED.

Then the user will be able to Browse all of the patient procedures without possibly changing things by messing with a ComboBox.

Good Luck,
JRB-Bldr


 
@ JRB=BLDR


I have a problem with the DATETIME overlap...
when i try and edit the record it tells me there is an overlap
although there really isnt since i am just editing an existing record?

 
mikeisvfp - if this is a question about your previous posting, then it should go there.

This posting is about putting a ComboBox into a Grid - which I think might not be the correct approach to what you are trying to do based on your saying that it is for Viewing ONLY.

Good Luck,
JRB-Bldr
 
but there are items in there, when i change the CurrentControl
back to text i see the very first item displayed.

Sounds like you didn't call the combo's Requery() after populating it.

But changing to a different interface makes a lot of sense.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top