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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

excel-like cell activation

Thread ID:





32584 Aug 3,2005 08:39 PM UTC Aug 4,2005 03:10 PM UTC WinForms 2
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);

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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