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.
Unfortunately, activation email could not send to your email. Please try again.

MaskEdit & ActivateCurrentCellBehavior

Thread ID:

Created:

Updated:

Platform:

Replies:

8183 Oct 24,2003 01:34 PM Oct 27,2003 10:16 AM Windows Forms 3
loading
Tags: GridControl
Doug
Asked On October 24, 2003 01:34 PM

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.

Administrator [Syncfusion]
Replied On October 25, 2003 05:18 AM

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);
	}
}

Doug
Replied On October 27, 2003 08:14 AM

Will this be fixed in 2.0? Thanks.

Administrator [Syncfusion]
Replied On October 27, 2003 10:16 AM

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

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;