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 09:48 PM UTC

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 10:09 PM UTC

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.
Up arrow icon