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

ChoiceList display size

Thread ID:

Created:

Updated:

Platform:

Replies:

7330 Sep 19,2003 02:37 PM UTC Sep 19,2003 05:13 PM UTC WinForms 2
loading
Tags: GridControl
Jonathan Guidry
Asked On September 19, 2003 02:37 PM UTC

How can I change the physical size of the dropdown list for a cell that is defined as a Choicelist? It's currently limited to 6 values. Thanks, Jonathan

Administrator [Syncfusion]
Replied On September 19, 2003 03:54 PM UTC

Hi, There is a DropDownRows property that you can set to control this. But it is buried a little deep, and generally needs an event handler to set it. The reason is that normally a single combobox cell control is shared among all combobox cells. And each cell can potentially have a different list, and may need different dropdownrows. So, to handle this, you can catch the CurrentCellShowingDropdown event, and set the property there depending upon the exact row and column. Below are some code snippets.

//C#

private void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)

{

	GridControlBase grid = sender as GridControlBase;

	if(grid != null)

	{

		GridCurrentCell cc = grid.CurrentCell;

		GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;

		if(cc != null)

		{

			if(cc.RowIndex == 6)

			    ((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 4;

			else if(cc.RowIndex == 4)

				((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 7;

			else if(cc.RowIndex == 2)

				((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 10;

			else

				((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 6;

		}

	}

}

Jonathan Guidry
Replied On September 19, 2003 05:13 PM UTC

works great thanks!

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

;