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
close icon

ComboBox Cell Dropdown

Hi,

I am using ComboBox in virtual mode with the following settings:
e.Style.DropDownStyle = GridDropDownStyle.Exclusive;
e.Style.ShowButtons = GridShowButtons.ShowCurrentCell;

Currently, when clicking the ComboBox cell, the dropdown displays automatically. My question is how to make the grid behaves like this: When first time click the cell, the button shows, but not the dropdown, only on a second click, the dropdown appears.

and similar question is for textbox cell, how to make the cell editable only on second click?

Thanks,

Q


1 Reply

JJ Jisha Joy Syncfusion Team September 23, 2010 09:52 AM UTC

Hi,

You can get this behavior by handling the CellDoubleClick event of the grid, in which try calling the ShowDropDown() method of the currentcell, if its of combobox celltype. Also, set the DropDownStyle to AutoComplete and the ActivateCurrentCellBehavior property of the grid to DblClickOnCell. Please see the code snippets below:
// CurrentCellActivated event of the grid
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if (cc.Renderer.StyleInfo.CellType == "ComboBox")
{
this.gridDataBoundGrid1.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell;
}
else
{
this.gridDataBoundGrid1.ActivateCurrentCellBehavior = GridCellActivateAction.ClickOnCell;
}

// CellDoubleClick event of the grid
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if (cc.Renderer.StyleInfo.CellType == "ComboBox")
{
cc.ShowDropDown();
}

Regards,
Jisha


Loader.
Live Chat Icon For mobile
Up arrow icon