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. Image for the cookie policy date

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 12:04 PM

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 01:25 PM

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.
Live Chat Icon For mobile
Up arrow icon