views:

162

answers:

1

I'd like to create a dropdown panel in WPF the acts like a ComboBox/Expander hybrid. I'm currently using an Expander but it pushes the the controls underneath it down when it expands.

I simply want it to act like a ComboBox and overlay it's dropdown. I've looked at using Popups but they don't move with the underlying window when it's moved.

So, I've concluded that the closest control to my needs is a ComboBox which allows me to put a Grid or StackPanel into its dropdown area.

Any ideas how to achieve this?

+1  A: 

I am not exactly sure what you want to do:

But the layout depends very much on the parent control. If your controls are in a Stackpanel all controls will be moved if a control expands or changes its size. If you use a Canvas you can align controls on top of each other.

Also Adorner are useful when you want overlay something above something else.

You can change the appearance of the ComboxBox and you can put a grid or anything else inside it. Have a closer look at ItemTemplate.

Holli
Many thanks Holli, I didn't consider the Adorner for this task. I'll also take a look at the ItemTemplate on the Combobox
Mitch