number of lines in ComboBox

Hi
I've tried to change the number of line of a combo box in a GridControl. But I never found a properties to change that. How can I change the number of row displayed, because only 6 rows is really not enough.


1 Reply

JJ Jisha Joy Syncfusion Team October 10, 2008 06:26 AM UTC

Hi Fredric,

This can be achieved by setting the DropDownRows property of the GridComboBoxListBoxPart to a specified value in the CurrentCellShowingDropDown event.

Please refer the code:


void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = this.gridControl1.CurrentCell;
if (cc.Renderer is GridComboBoxCellRenderer)
{
GridComboBoxCellRenderer dr = cc.Renderer as GridComboBoxCellRenderer;
((GridComboBoxListBoxPart)dr.ListBoxPart).DropDownRows = 12;
}

}



Please let me know if this helps.

Regards,
Jisha


Loader.
Up arrow icon