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.
Unfortunately, activation email could not send to your email. Please try again.

Setting a grid dropdown height

Thread ID:

Created:

Updated:

Platform:

Replies:

73142 Apr 22,2008 06:09 AM Apr 24,2008 06:56 AM Windows Forms 1
loading
Tags: Grouping
Shane
Asked On April 22, 2008 06:09 AM

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 06:56 AM

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:

http://www.syncfusion.com/support/user/uploads/GGC_combo_7b410857.zip



Regards,
Jisha


CONFIRMATION

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.

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.

;