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

Listview Subitem: Combobox

Status
Not open for further replies.

rennis

Programmer
Dec 6, 2006
80
CA
Is it possible to add a combo box/drop down to each cell in column 1 of a listview? I did try the method of repositioning of the width, left and top, however i was unable to adjust the height of the combo. Also, this combo was restricted to just the first cell in the first column. What i need to accomplish is add a combo box to the each cell once a button is clicked. So the first time its clicked, a combo goes to Row 1 column 1, the second time its click, a combo goes to row 2 column 1. Any help would be greatly appreciated.
 
The solution posted for you in thread222-1335492 should work fine for any cell. Just reposition the combo by changing its Top value

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
I did that, but Im unable to change the height of the combo box (and the bottom of the combo transfers into the next subitem below it) as it is read only for some reason. And this wont allowed me to add a combo box to each cell i click in that first column...

Appreciate your help though
 
Reduce the font size of the Combo or increase the font size of the ListView.

[gray]Experience is something you don't get until just after you need it.[/gray]
 


You seem to be telling us that your problem is the height of the closed combobox not being the same as the row heigth of a list view item (Combobox=315 and ListItem =255)

This is because the ComboBox has an icon (The drop-down arrow).
The ListItem Row height is also read only, I think.

So, You may only have three choices:

1. Use a FlexGrid. This may be easier in the long run.

2. Create an arrow icon and set the listview's ListItem.SmallIcon\ListSubItem.ReportIcon to it. When the cell with the icon is clicked, position and show a listBox.
The only problem with this, is that the arrow icon will be positioned on the left side.

3. Create your own drop-down arrow on a commandbutton to the size you want it to be, position it, and when clicked, position, show and open your combo box, or just a simple listbox.

4. Change the ListView Font\Font-size to a size matching the height of the combo, then the listview rows will adjust.
 
5. Use a hidden popup context menu if you want to choose an item from a list of possible choices. It will be much easier to implement than positioning a combo box or list box.
 

That's also a nice idea. You may still want some icon to identify that the cell does have a list of choices avaiable, unless all cells do.
 
Thanks everyone for your replies. Is it possible to use the combo boxes flat style icon?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top