We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Number of visible items in ComboBoxAdv WPF

How do I control the number of visible items in a ComboBoxAdv? For example, we have a multiselect combobox bound to an itemssource with 50 items. The user can only see FOUR items at a time (of course, the scrollbar can be used to see more). How can we increase this number from four to something higher?



2 Replies

MJ Marcus johansson April 20, 2020 11:08 PM

It appears the problem only occurs when the number of items in the itemssource changes after the ComboBoxAdv component has been initialized. In our case, the itemssource is empty (has zero items) at initialization but later grows. In this case, the dropdown list only shows four items at a time.


DV Duraimurugan Vedagiri Syncfusion Team April 21, 2020 04:01 AM

Hi Marcus,

Thanks for using syncfusion products.

Currently ComboBoxAdv doesn’t have direct support to achieve the reported requirement "How define number of visible items in a ComboBoxAdv
dropdown". Instead we suggest the work around solution to meet your requirement that you can customize a ComboBoxAdv.ItemTemplate and define TextBlock height corresponding to the dropdown height.

Code Snippet 
<Grid> 
    <syncfusion:ComboBoxAdv x:Name="comboBoxAdv1" DefaultText="..Choose Items.." ItemsSource="{Binding StudentList}" Height="50" Width="300" MaxDropDownHeight="{Binding DropDownHeight}"> 
        <syncfusion:ComboBoxAdv.ItemTemplate> 
            <DataTemplate> 
                <TextBlock Text="{Binding Name}" Height="{Binding ItemHeight}"/> 
            </DataTemplate> 
        </syncfusion:ComboBoxAdv.ItemTemplate> 
    </syncfusion:ComboBoxAdv> 
</Grid> 

Here is the sample that works as expected.
https://www.syncfusion.com/downloads/support/forum/153490/ze/ComboBoxAdvSample-210647169.zip  

Regards,
Durai
 


Loader.
Live Chat Icon For mobile
Up arrow icon