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

Cell activation behavior

I would like to achieve the following behavior when I click on a cell:

1. Single click just makes the cell the active cell. Does not start editing.
2. Double click on a cell starts editing.
3. When I start editing, select the entire current value.

If I set
sfGrid.Model.Options.ActivateCurrentCellBehavior =
GridCellActivateAction.DblClickOnCell;

That accomplishes #1 and #2. But even though it is in edit mode, the cursor is not within the textbox, and nothing is selected.

There is another GridCellActivationAction called SelectAll, but it doesn't seem to work for me. I've tried combining them both (using |), and just using SelectAll by itself, but never does the current text get selected in the cell. I've also tried PositionCaret, and that doesn't seem to work either.

3 Replies

MN Muthulakshmi N Syncfusion Team July 2, 2010 01:06 PM UTC


You can achieve your entire requirements by using GridCellActivateAction.DblClickOnCell itself. I have attached a sample and a video which illustrates your requirement. Please download the sample and video from the below location.

Sample Link:
http://www.syncfusion.com/uploads/redirect.aspx?file=SilverlightApplication1_6cd9377b.zip&team=development

Video Link:
http://www.syncfusion.com/uploads/redirect.aspx?file=finalsamp_b2dcc530.rar&team=development

Let me know if you need any other details.

Regards,
Muthulakshmi.N


AD Administrator Syncfusion Team July 2, 2010 03:14 PM UTC

I figured out why mine does not work. I can make your sample not work if I put the GridControl inside a ScrollableContentViewer, and I reference my version of the Silverlight dlls (8.204.0.18 + hotfixes).

After I make those changes to the sample, when I double click on a cell, it does not select the text within the editor. Somehow the ScrollableContentViewer breaks the cell activation with my version.

The version included with your sample is 8.304.0.2. I don't even know how to get this version. The strange thing is that the date of the dll is older than the date of mine, because I have been getting hotfixes. I can tell the sample version does not have some of them, in particular the fix for the 1 pixel borders.

Anyway.. it seems like it might be fixed once I can get all the latest versions. As of 8.204.0.18, however, if you put a GridControl inside a ScrollableContentViewer, the cell activation does not work right.


MN Muthulakshmi N Syncfusion Team July 15, 2010 12:27 PM UTC

Hi Jaimie,

Thank you for your interest in our Syncfusion products.
Here We prepared a sample which illustrates your request. In this sample GridControl is placed inside the ScrollableContentViewer. Please download the sample from the below location.

Link:
http://www.syncfusion.com/uploads/redirect.aspx?file=GridinScrollabeContentViewer_9feb3eb.zip&team=development

XAML:




Let us know if you need any details.

Regards,
Muthulaskhmi

Loader.
Live Chat Icon For mobile
Up arrow icon