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

F2 sets cell in editmode despite Readonly=true

I''ve set the readonly property on the tablestyle.
and set ActivateCurrentCellBehavior = GridCellActivateAction.None.

However, when I press F2, the current cell goes into editmode (shows caret). It does not allow actually changing the cell contents though.

Is there any way to prevent the caret from showing in this case?

Thanks

5 Replies

AD Administrator Syncfusion Team August 11, 2006 10:39 AM UTC

Hi Palmer,

In the CurrentCellKeyDown event handler, check for e.KeyCode to be F2 and handle the event by setting e.Handled to true. This will help you.

// CurrentCellKeyDown_Event
if( e.KeyCode == Keys.F2 )
{
e.Handled = true;
}

Regards,
Rajagopal


AD Administrator Syncfusion Team August 11, 2006 12:00 PM UTC

That works.

Can you log this as a bug in the "TextBox" cell type?
There''s no reason for the cell to go in editmode in this situation.


AD Administrator Syncfusion Team August 14, 2006 08:30 AM UTC

Hi Palmer,

This is the default behavior. When you press F2, BeginEdit() method is called, which causes the caret to go inside the cell. Instead of setting the ReadOny property to true, set the celltype to Static for all the grid cells.

this.gridControl1.TableStyle.CellType = "Static";

Thanks,
Rajagopal


AD Administrator Syncfusion Team August 16, 2006 08:27 AM UTC

Hi Rajagopal,

Surely the default behaviour doesn''t make sense in this case?

If the cell is readonly its contents can''t be changed so why set the caret in that case, it only confuses the end user.

If you don''t want to call it a bug, can you then log it as a feature request?


AD Administrator Syncfusion Team August 16, 2006 10:26 AM UTC

Hi Palmer,

I have contacted the development team regarding this issue and will be updating you soon. Sorry for the inconvenience caused.

Thanks for your patience.
Best Regards,
Haneef

Loader.
Live Chat Icon For mobile
Up arrow icon