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.
Unfortunately, activation email could not send to your email. Please try again.

How to set drop-down list height

Thread ID:

Created:

Updated:

Platform:

Replies:

30711 Jun 22,2005 11:24 AM Jun 22,2005 02:25 PM Windows Forms 2
loading
Tags: GridControl
Lan Mo
Asked On June 22, 2005 11:24 AM

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 01: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;
	}
}

Lan Mo
Replied On June 22, 2005 02: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;
>	}
>}
>

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.

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.

;