How to show dropdown when item list is empty

2 posts, 0 answers
  1. Pathru
    Pathru avatar
    1 posts
    Member since:
    Jul 2013

    Posted 11 Jul 2013 Link to this post

    The RedComboBox displaying list of items for selection and this list will be empty to start with. If this list is empty, user should see an empty drop down so that the User knows there is nothing to select. With my code below, I just see a small 2 pixel line below combo, this give an impression to user that something is wrong with application. If you use windows provided ComboBox then it will a empty dropdown and we want the same behavior from RedComboBox.

    How can I enable dropdown even if there are no items in the list?

       SelectedItem="{Binding Path=Item, Mode=TwoWay}"
       ItemsSource="{Binding Path= ItemList}"
       EmptyText=" - select an item - "/>
  2. Georgi
    Georgi avatar
    344 posts

    Posted 16 Jul 2013 Link to this post

    Hi Pathru,

    What you can do is set a min height suitable for you to the Popup that opens and so when it opens it would stay as big as you need. I have attached a simple project showing how you can edit the template of the RadComboBox and set the MinHeight:
    <Popup x:Name="PART_Popup">
                                    <Grid x:Name="PopupRoot" MinHeight="150">
                                        <Border x:Name="PART_ResizeBorder".......

    Please note that this style will be applied only to the given ComboBox and if you need to add it to all ComboBoxes you can use implicit styles. Also you need to know that it will work only for non editable ComboBoxes as there are two templates - one for editable ComboBox and on for not editable. So if you want to apply it to editable ComboBoxes you just need to set MinHeight in the template the same popup which is under the "EditableTemplate":
    <Setter Property="EditableTemplate">
    <Popup x:Name="PART_Popup">
                                    <Grid x:Name="PopupRoot">

    If you have any other questions, please don't hesitate to contact us.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. DevCraft banner
Back to Top