Autodropdown of ComboBox Cell

Hi,

I am looking for the following behaviour of a combobox cell:
The Combobox has ExclusiveChoiceList = true; like the one in the CellControlsGrid_2005 Sample in Cell C23. When I start typing the list should open so that I can use the up and down keys to select a value. How Can I achieve this?

Regards,
Christian

3 Replies

HA haneefm Syncfusion Team April 4, 2007 05:16 PM UTC

Hi Christian,

You can try this.

this.grid.Model[1,1].CellType ="ComboBox";
this.grid.Model[1,1].ChoiceList = stCollection;
this.grid.Model[1,1].DropDownStyle = GridDropDownStyle.AutoComplete.

Also refer the following forum thread for autocomplete textbox in a grid.
http://www.syncfusion.com/support/forums/message.aspx?&MessageID=49800

Best regards,
Haneef


CL Christian Lützenkirchen April 4, 2007 05:56 PM UTC

Hi Haneef,

thank you for your sample. Setting DropDownStyle = GridDropDownStyle.AutoComplete does not drop down the list. The first sample has the behaviour I want, I have to add a dropdown button.

Am I right that there is no property to do this with the standard-control?

Best Regards,
Christian


HA haneefm Syncfusion Team April 4, 2007 06:14 PM UTC

Hi Christian,

One way you can do this by handling the CurrentCellKeyPress event and call the ShowDropDown method for autocomplete combobox cell in a grid. The following is the code snippet.

private void gridControl1_CurrentCellKeyPress(object sender, KeyPressEventArgs e)
{
GridControl grid = sender as GridControl;
GridCurrentCell cc = grid.CurrentCell;
if( !cc.IsDroppedDown )
cc.ShowDropDown();
}

Best regards,
Haneef

Loader.
Up arrow icon