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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to set drop-down list height

Thread ID:

Created:

Updated:

Platform:

Replies:

30711 Jun 22,2005 03:24 PM UTC Jun 22,2005 06:25 PM UTC WinForms 2
loading
Tags: GridControl
Lan Mo
Asked On June 22, 2005 03:24 PM UTC

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;

Administrator [Syncfusion]
Replied On 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;
	}
}

Lan Mo
Replied On 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;
>	}
>}
>

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;