How Do I Display More than Six Dropdown Rows in a GridDataBoundGrid ComboBox?

I'm displaying a ComboBox in a cell of a GridDataBoundGrid. By default, the ComboBox displays only six items in the dropdown list. I'd like to display many more items, but I can't figure out how. Any suggestions?

-TC


1 Reply

JJ Jisha Joy Syncfusion Team March 17, 2011 11:05 AM UTC

Hi,

You can handle the CurrentCellShowingDropDown event and set the dropdown size as desired,

void gridDataBoundGrid1_CurrentCellShowingDropDown(object sender, Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventArgs e)
{
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
if (cr != null)
{
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = cr.ListBoxPart.Items.Count;

}

}

Regards,
Jisha


Loader.
Up arrow icon