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.
Syncfusion Feedback

excel-like cell activation

Thread ID:

Created:

Updated:

Platform:

Replies:

32584 Aug 3,2005 08:39 PM UTC Aug 4,2005 03:10 PM UTC Windows Forms 2
loading
Tags: GridControl
Craig Timmerman
Asked On August 3, 2005 08:39 PM UTC

I am trying to get an excel-like cell activation behavior for cell with textbox editing--single click lt mouse button activates cell, but no insert caret, dbl-click activates cell and puts insert caret at mouse position. Setting Grid.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell gets close, but when user Dbl clicks, the insert caret is not positioned where the mouse is.

Administrator [Syncfusion]
Replied On August 3, 2005 10:08 PM UTC

There is no property setting for this. I think you can get this behavior using an event and a timer.
//in form.load
this.gridControl1.CellDoubleClick += new GridCellClickEventHandler(gridControl1_CellDoubleClick);
this.gridControl1.ActivateCurrentCellBehavior = GridCellActivateAction.DblClickOnCell;


private Timer t = null; 
private void gridControl1_CellDoubleClick(object sender, GridCellClickEventArgs e)
{
	if(this.t == null)
	{
		this.t = new Timer();
		this.t.Interval = 10;
		this.t.Tick += new EventHandler(t_Tick);
	}
	this.t.Start();			
}

private void t_Tick(object sender, EventArgs e)
{
	this.t.Stop();
	GridTextBoxCellRenderer cr = this.gridControl1.CurrentCell.Renderer as GridTextBoxCellRenderer;
	if(cr.TextBox != null)
	{
		Point pt = cr.TextBox.PointToClient(Control.MousePosition);
		Syncfusion.Drawing.ActiveXSnapshot.FakeLeftMouseClick(cr.TextBox, pt);
	}
}

Craig Timmerman
Replied On August 4, 2005 03:10 PM UTC

Works great. Many thanks. >There is no property setting for this. > >I think you can get this behavior using an event and a timer.

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.

Warning Icon 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.Close Icon

;