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

how to get CellDoubleClick event fired?

this.grid.CellDoubleClick += new GridCellClickEventHandler(grid_CellDoubleClick); private void grid_CellDoubleClick(object sender, GridCellClickEventArgs e) { Console.WriteLine("Double clicked"); } this works when the cell on my grid is "Static" but doesn''t work after i populate the grid with some data and change the CellType to "TextBox" in other words, the event is not fired when i have the editing caret inside a cell why? and any way around this? thanks in advance!

7 Replies

AD Administrator Syncfusion Team May 26, 2004 06:00 AM UTC

Try the CurrentCellControlDoubleClick event to see if that gives you what you need.


AD Administrator Syncfusion Team May 26, 2004 05:33 PM UTC

thanks Clay but the version of syncfusion i have doesn''t have the metioned event is there any other way of doing it? >Try the CurrentCellControlDoubleClick event to see if that gives you what you need.


AD Administrator Syncfusion Team May 26, 2004 07:04 PM UTC

You could try to use the technique discussed in this forum thread. http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=14267 The idea would be to listen to CurrentCellControlGotFocus and subscribe teh the double click event of teh cell control there. Then in CurrentCellControlLostFocus, unsubscribe to it.


AD Administrator Syncfusion Team May 27, 2004 08:45 PM UTC

this technique doesn''t work for double click private void gridControl1_CurrentCellControlLostFocus(object sender, System.Windows.Forms.ControlEventArgs e) { e.Control.DoubleClick -= new EventHandler(Control_DoubleClick); Console.WriteLine("xHooked"); } private void gridControl1_CurrentCellControlGotFocus(object sender, System.Windows.Forms.ControlEventArgs e) { e.Control.DoubleClick += new EventHandler(Control_DoubleClick); Console.WriteLine("Hooked"); } private void Control_DoubleClick(object sender, EventArgs e) { Console.WriteLine("double clicked!"); } the double click event is never fired >You could try to use the technique discussed in this forum thread. > >http://www.syncfusion.com/Support/Forums/message.aspx?MessageID=14267 > >The idea would be to listen to CurrentCellControlGotFocus and subscribe teh the double click event of teh cell control there. Then in CurrentCellControlLostFocus, unsubscribe to it. > >


AD Administrator Syncfusion Team May 27, 2004 09:27 PM UTC

From you discussion above, I thought you were trying to catch a double click on a cell that already was showing the edit cursor. And I thought the code you showed above would catch this case. (It seemed to do so when I tried it). But if you want to catch a double click on a cell that is NOT showing the edit cursor, then it takes more work (unless you upgrade to the release that has the CurrentCellControlDoubleClick event). Below is a sample that seems to catch double clicks in both cases. It uses the technique described above to catch the double click on an editing cell. To catch the double click on an cell that is not editing, it handles single click events both in the grid and in the cell control, testing to see if the two events are handled within doubleclick time. If they are, then it marks it as a doubleclick. DoubleClick_5180.zip


AD Administrator Syncfusion Team May 27, 2004 10:07 PM UTC

thanks clay, but the sample code doesn''t work on my machine, i got both Syncfuion.Grid and Syncfusion.Shared dlls versioned 1.5.2.0 is that the problem? >From you discussion above, I thought you were trying to catch a double click on a cell that already was showing the edit cursor. And I thought the code you showed above would catch this case. (It seemed to do so when I tried it). > >But if you want to catch a double click on a cell that is NOT showing the edit cursor, then it takes more work (unless you upgrade to the release that has the CurrentCellControlDoubleClick event). Below is a sample that seems to catch double clicks in both cases. It uses the technique described above to catch the double click on an editing cell. To catch the double click on an cell that is not editing, it handles single click events both in the grid and in the cell control, testing to see if the two events are handled within doubleclick time. If they are, then it marks it as a doubleclick. > >DoubleClick_5180.zip > >


AD Administrator Syncfusion Team May 28, 2004 06:20 AM UTC

Yes, that does seem to be the problem. In 1.5.2.0, the cell control is eating the clicks (to position teh cursor or select all the text), and not notifying the grid of the click. Without deriving several classes in 1.5.2.0, I do not know of a way to try to work around this problem. It probably would be simpler to update to a later version. This is changed in the 1.6.1.8 and 2.0 code bases.

Loader.
Live Chat Icon For mobile
Up arrow icon