locked
ComboBox MaxDropDownHeight not working RRS feed

  • Question

  • I am using a ComboBox and I am trying to control how many items it shows when it is dropped down. There doesn't seem to be a specific setting for that, so I tried using MaxDropDownHeight to see if I could achieve what I wanted. \

    This doesn't seem to have ant effect at all, no matter what I set it to, the drop down is always displayed at the same size.

    Any ideas?

    Steve

    Thursday, May 17, 2012 5:13 PM

All replies

  • What language are you programing in?  I will move this to the correct queue.

    Jeff Sanders (MSFT)

    Thursday, May 17, 2012 6:21 PM
    Moderator
  • hi, TheHaacker

    I also have issue: ComboBox MaxDropDownHeight not working

    Did you find the cause?


    Wednesday, July 4, 2012 5:58 AM
  • What language are you programing in? I will move this to the correct queue.

    Jeff Sanders (MSFT)

    Thursday, July 5, 2012 12:34 PM
    Moderator
  • C sharp
    Friday, July 13, 2012 5:49 AM
  • Sorry for the problems. This property is ignored in XAML currently when using a CarouselPanel as the ItemsPanel (which is the default). You would need to switch the ItemsPanel for ComboBox if you need a different behavior.

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Friday, July 13, 2012 10:25 PM
  • I would also like an answer on this question.

    MaxDropDownHeight on COMBOBOX does not work. How can we work around this?

    /Iris

    Thursday, July 19, 2012 2:24 AM
  • If you switch out the ItemsPanel of the ComboBox to a VirtualizingStackPanel or StackPanel then the MaxDropDownHeight will work. It is ignored when using the CarouselPanel.

    Hope this helps!
    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Thursday, July 19, 2012 8:26 PM
  • Hi, thank you for the answer. I tried, but it still wont respect the MaxDropDownHeight. If I set a Maxheight on the virtualizing stackpanel as well the maxheight is respected, but the the popup is not centered when opened if one of the lower items in the list is selected.

    Could you please show some code were it actually works? - it would be of great help :) I might be doing something wrong, or there might be a bug. I don't know :)


    Friday, July 20, 2012 11:52 AM
  • Hmm, my bad. I thought I had tried switching out the ItemsPanel and thought the MaxDropDownHeight was honored. Looks like this behavior was removed in favor of the custom layout logic for centering. As a result the MaxDropDownHeight is ignored. You would have to resort to custom layout logic of the popup on your own -- calculating how to center it and such. You would need to derive from ComboBox and override logic there. Not easy to do at all, sorry.

    Can you help me understand what you are attempting to accomplish? What scenario? I can track the issue for the future.

    -mark
    Program Manager
    Microsoft
    This post is provided "as-is"

    Friday, July 20, 2012 6:16 PM