This is a migrated thread and some comments may be shown as answers.

Flip GridViewColumn between CellTemplate and CellEditTemplate programmatically

2 Answers 52 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sterren
Top achievements
Rank 1
Sterren asked on 22 May 2013, 03:08 PM
Hi,

I want to be able to handle key events on the GridView that will flip a GridViewColumn between view mode and edit mode programmatically. How do I do this?

Thanks, Sterren

2 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 27 May 2013, 08:53 AM
Hello Sterren,

It depends on what Keys you would like to use for this purpose. If the GridView does not handle those keys internally, then you can just subscribe for the KeyDown event of the GridView and invoke BeginEdit for it.

If your key is special and the GridView already handles it, then you could create your own custom keyboard provider. Please refer to our online documentation for further details. You can define behavior for the keys you are interested in overriding the ProvideCommandsForKey method. 

Regards,
Didie
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Sterren
Top achievements
Rank 1
answered on 28 May 2013, 11:19 AM
Thank you Didie, that did the trick! I created a keyboard command handler for our grid and that fixed the issue we were having.
Tags
GridView
Asked by
Sterren
Top achievements
Rank 1
Answers by
Dimitrina
Telerik team
Sterren
Top achievements
Rank 1
Share this question
or