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

Setting a grid dropdown height

Thread ID:





73142 Apr 22,2008 10:09 AM UTC Apr 24,2008 10:56 AM UTC WinForms 1
Tags: Grouping
Asked On April 22, 2008 10:09 AM UTC

I have a dropdown in a grouping grid and I want the dropdown to resize depending and the number of items in the list. This is so all items will be displayed without the need for a vertical scroll bar.

Administrator [Syncfusion]
Replied On April 24, 2008 10:56 AM UTC

Hi Shane,

This can be achieved by handled by the TableControlCurrentCellShowingDropDown event of GridGroupingControl. Please refer the code:

this.gridGroupingControl1.TableControlCurrentCellShowingDropDown += new Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellShowingDropDownEventHandler(gridGroupingControl1_TableControlCurrentCellShowingDropDown);

void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellShowingDropDownEventArgs e)
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
if (cc.Renderer is GridComboBoxCellRenderer)
GridComboBoxCellRenderer dr = cc.Renderer as GridComboBoxCellRenderer;
((GridComboBoxListBoxPart)dr.ListBoxPart).DropDownRows = s.Count;

Please refer the sample:




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

or the page will be automatically redirected to 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