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.

excel-like cell activation

Thread ID:





32584 Aug 3,2005 04:39 PM Aug 4,2005 11:10 AM Windows Forms 2
Tags: GridControl
Craig Timmerman
Asked On August 3, 2005 04:39 PM

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 06:08 PM

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

private void t_Tick(object sender, EventArgs e)
	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 11:10 AM

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


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.