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

MaskEdit & ActivateCurrentCellBehavior

I set the ActivateCurrentCellBehavior property to DblClickOnCell for a MaskEdit cell and it does not work at all. It still is activated in edit mode with a cursor with only a single click. I need to be able to click on a MaskEdit cell and select it without it being in edit mode with a cursor. Is there a plan to fix this? This behaves perfectly fine for a TextBox, but not for MaskEdit. Thanks.

3 Replies

AD Administrator Syncfusion Team October 25, 2003 09:18 AM UTC

We will eventually handle this in our code base. For now, here is a work around. //subscribe to these event this.gridControl2.CurrentCellActivating += new GridCurrentCellActivatingEventHandler(gridControl2_CurrentCellActivating); this.gridControl2.CellDoubleClick += new Syncfusion.Windows.Forms.Grid.GridCellClickEventHandler(this.gridControl2_CellDoubleClick); this.gridControl2.CurrentCellStartEditing += new CancelEventHandler(gridControl2_CurrentCellStartEditing); Here are the event handlers and a private member.
private int avoidAutomaticSwitchToEditMode = 0; 

private void gridControl2_CurrentCellActivating(object sender, GridCurrentCellActivatingEventArgs e) 
{ 
	GridCurrentCell cc = this.gridControl2.CurrentCell; 
	GridStyleInfo style = this.gridControl2[e.RowIndex, e.ColIndex]; 
	if (style.CellType == "MaskEdit") 
		avoidAutomaticSwitchToEditMode = 2; 
} 

private void gridControl2_CurrentCellStartEditing(object sender, CancelEventArgs e) 
{ 
	if (avoidAutomaticSwitchToEditMode > 0) 
		e.Cancel = true; 
	avoidAutomaticSwitchToEditMode = Math.Max(0, avoidAutomaticSwitchToEditMode - 1);
} 

private void gridControl2_CellDoubleClick(object sender, GridCellClickEventArgs e)
{
	GridCurrentCell cc = this.gridControl2.CurrentCell; 
	GridStyleInfo style = this.gridControl2[e.RowIndex, e.ColIndex]; 
	if (style.CellType == "MaskEdit") 
	{
		avoidAutomaticSwitchToEditMode = 0; 
		cc.BeginEdit(true);
	}
}


DO Doug October 27, 2003 01:14 PM UTC

Will this be fixed in 2.0? Thanks.


AD Administrator Syncfusion Team October 27, 2003 03:16 PM UTC

No, this will have to wait until after 2.0 as there are higher priority things that need to be handled.

Loader.
Live Chat Icon For mobile
Up arrow icon