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

Expand drop down list on cell edit

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

2 Replies

AD Administrator Syncfusion Team August 21, 2004 04: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;
	}
}


TS Todd Swygert August 22, 2004 05: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;
>	}
>}
>

Loader.
Live Chat Icon For mobile
Up arrow icon