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.

Expand drop down list on cell edit

Thread ID:

Created:

Updated:

Platform:

Replies:

18003 Aug 21,2004 04:21 PM Aug 22,2004 06:09 PM Windows Forms 2
loading
Tags: GridControl
Todd Swygert
Asked On August 21, 2004 04:21 PM

I''m using a GridDataBoundGrid and some of my GridBoundColumns are of type ComboBox with a DropDownStyle of AutoComplete. My question is how can I expand the drop down list as the user begins to edit the cell? I could change to a DropDownStyle of Editable if it makes a difference. Thank you, Todd

Administrator [Syncfusion]
Replied On August 21, 2004 05:48 PM

Try handling the CurrentCellStartEditing and drop the list there. You have to make sure you do not get in a recursive loop though, as showing the DropDown will trigger a CurrentCellStartEditing event.
private bool showingDropDown = false;
private void gridControl1_CurrentCellStartEditing(object sender, CancelEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(this.gridControl1[cc.RowIndex, cc.ColIndex].CellType == "ComboBox"
		&& !cc.IsDroppedDown && !showingDropDown)
	{
		showingDropDown = true;
		cc.ShowDropDown();
		showingDropDown = false;
	}
}

Todd Swygert
Replied On August 22, 2004 06:09 PM

Perfect, thanks. >Try handling the CurrentCellStartEditing and drop the list there. You have to make sure you do not get in a recursive loop though, as showing the DropDown will trigger a CurrentCellStartEditing event. > >
>private bool showingDropDown = false;
>private void gridControl1_CurrentCellStartEditing(object sender, CancelEventArgs e)
>{
>	GridCurrentCell cc = this.gridControl1.CurrentCell;
>	if(this.gridControl1[cc.RowIndex, cc.ColIndex].CellType == "ComboBox"
>		&& !cc.IsDroppedDown && !showingDropDown)
>	{
>		showingDropDown = true;
>		cc.ShowDropDown();
>		showingDropDown = false;
>	}
>}
>

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.

;