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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to control the number of visible items in a ComboBox cell?

Platform: WinForms |
Control: GridControl |
Published Date: January 3, 2016 |
Last Revised Date: January 3, 2016

In order to control the items showing in dropdown of combo box, GridComboBoxListBoxPart.DropDownRows property can be used. The GridComboBoxListBoxPart is the actual control type of the list that is dropped to display the items. But, it is buried a little deep and generally needs an event handler to set it.

The reason for using an event handler is that normally a single ComboBox control is shared among all ComboBox cells. Each cell can potentially have a different list and may need different numbers of visible rows. So to handle this, you must catch Grid.CurrentCellShowingDropDown event and set the property there depending upon the exact row and column.

Code Snippet

C#

 

VB

 

Screenshot

Sample Link

C#: DropDownRows_ComboBox_CS

VB: DropDownRows_ComboBox_VB

 

2X faster development

The ultimate WinForms UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon