How to set drop-down list height

Hello, In GGC,I used following code to set a combobox pickup list. I want to set the drop-down list to 20 rows. which property to use? this.gdBase.TableDescriptor.Columns[ColumnName].Appearance.AnyRecordFieldCell.CellType ="ComboBox"; this.gdBase.TableDescriptor.Columns[ColumnName].Appearance.AnyRecordFieldCell.DataSource=dvLookUp;//tbLookup; this.gdBase.TableDescriptor.Columns[ColumnName].Appearance.AnyRecordFieldCell.DisplayMember=lookup_field_val; this.gdBase.TableDescriptor.Columns[ColumnName].Appearance.AnyRecordFieldCell.ValueMember=lookup_field_code; this.gdBase.TableDescriptor.Columns[ColumnName].Appearance.AnyRecordFieldCell.ShowButtons=GridShowButtons.ShowCurrentCell;

2 Replies

AD Administrator Syncfusion Team June 22, 2005 05:04 PM UTC

You can handle the TableControlCurrentCellShowingDropDown event. In your handler, try code like this.
GridControlBase grid = e.TableControl as GridControlBase;
if(grid != null)
{
	GridCurrentCell cc = grid.CurrentCell;
	GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
	if(cc != null)
	{
		GridComboBoxListBoxPart listBoxPart = (GridComboBoxListBoxPart)cr.ListBoxPart;
		listBoxPart.DropDownRows = yourMaxItemCount;
	}
}


LM Lan Mo June 22, 2005 06:25 PM UTC

Thanks, it works. >You can handle the TableControlCurrentCellShowingDropDown event. >In your handler, try code like this. >
>GridControlBase grid = e.TableControl as GridControlBase;
>if(grid != null)
>{
>	GridCurrentCell cc = grid.CurrentCell;
>	GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
>	if(cc != null)
>	{
>		GridComboBoxListBoxPart listBoxPart = (GridComboBoxListBoxPart)cr.ListBoxPart;
>		listBoxPart.DropDownRows = yourMaxItemCount;
>	}
>}
>

Loader.
Up arrow icon