Increasing the number of items in a combo box

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

2 Replies

AJ Ajish Syncfusion Team September 3, 2007 10:42 PM UTC

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.


SR Stephen Rose September 4, 2007 08:59 AM UTC

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.

Loader.
Up arrow icon