allow editing the cell only when double click

Hi Sir/Madem,

I have a GridDataBoundGrid and would like to allow editing the cell only when user double click on the cell.

I had set ActivateCurrentCellBehavior to DblClickOnCell but seems that the current cell can always allow to be edited.

Are there any solution on this. Pls advice.

Regards,
Jasper

1 Reply

HA haneefm Syncfusion Team July 25, 2007 07:10 PM UTC

Hi Jasper,

You can try these code:

bool IsDoubleClick = false;
void gridDataBoundGrid1_CellDoubleClick(object sender, GridCellClickEventArgs e)
{
IsDoubleClick = true;
}
void gridDataBoundGrid1_CurrentCellStartEditing(object sender, CancelEventArgs e)
{
if (!IsDoubleClick)
e.Cancel = true;
else
IsDoubleClick = false;
}

Best regards,
Haneef

Loader.
Up arrow icon