tags:

views:

1238

answers:

2

I have a combobox in WPF that I add items to at run-time (via a data binding to a List). I'd like to set the height of the dropdown box dynamically so that all (or most) of the items show. Unfortunately it seems that the height of the dropdown is set once and cannot be dynamically altered. It always seems to be the same size.

Is there some relatively straightforward to adjust the dropdown height?

Thanks, --Mike

+1  A: 

The property MaxDropDownHeight is a dependency property on the combo box that controls the height of the drop down list. Since it's a dependency property it's value can be set dynamically.

Have you tried setting this value?

w4g3n3r
A: 

Yes, I've tried setting it after adding the items to the combobox. In the debugger it looks like the new value is there. However, when I open the dropdown, it drops down to a size of its own choosing. I've tried exaggerating the MaxDropDownHeight and have even set it to "Auto" to no avail.

--Mike

The ChiliCat