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.

Increasing the number of items in a combo box

Thread ID:

Created:

Updated:

Platform:

Replies:

67874 Sep 3,2007 01:33 PM Sep 4,2007 04:59 AM Windows Forms 2
loading
Tags: GridControl
Stephen Rose
Asked On September 3, 2007 01:33 PM

Our users would like our combo box cells to show more items when they are dropped down. How would I go about doing this?

Cheers
Steve

Ajish [Syncfusion]
Replied On September 3, 2007 06:42 PM

Hi Steve,

Thank you for your interest in Syncfusion product.

Please try setting the DrowDownRows property to resize the dropdown height. This can be achieved by handling the TableControlCurrentCellShowingDropDown event. In the event, the GridComboBoxCellRenderer is retrieved and DropDownRows property is to set the required. The following is the code snippet.

>>>>>
private void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
if(cc != null)
{
if (cc.RowIndex == 4 && cc.ColIndex==1)
{
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows =1;
}
else if(cc.RowIndex == 5 && cc.ColIndex==1)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 10;
}
}
>>>>>

Here is the link for the sample:
http://websamples.syncfusion.com/samples/Grid.Windows/F67874/main.htm

Kindly let me know if you need any further assistance.

Regards,
Ajish.

Stephen Rose
Replied On September 4, 2007 04:59 AM

Thanks, That worked!

Cheers
Steve

>Hi Steve,

Thank you for your interest in Syncfusion product.

Please try setting the DrowDownRows property to resize the dropdown height. This can be achieved by handling the TableControlCurrentCellShowingDropDown event. In the event, the GridComboBoxCellRenderer is retrieved and DropDownRows property is to set the required. The following is the code snippet.

>>>>>
private void gridGroupingControl1_TableControlCurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = this.gridGroupingControl1.TableControl.CurrentCell;
GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
if(cc != null)
{
if (cc.RowIndex == 4 && cc.ColIndex==1)
{
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows =1;
}
else if(cc.RowIndex == 5 && cc.ColIndex==1)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 10;
}
}
>>>>>

Here is the link for the sample:
http://websamples.syncfusion.com/samples/Grid.Windows/F67874/main.htm

Kindly let me know if you need any further assistance.

Regards,
Ajish.

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.

;