Ujjwal Lahoti
Top achievements
Rank 1
Ujjwal Lahoti
asked on 07 Apr 2010, 07:24 AM
Default setting for the EditTriggers in the DataGrid is "Mouse DoubleClick". However I want to be able to edit the cells if either of the following events happen:
1. Enter Key Press
2. Mouse DoubleClick
3. F2 Key Press
Can you tell me how to do this? I didn't find anything in the documentation regarding this.
1. Enter Key Press
2. Mouse DoubleClick
3. F2 Key Press
Can you tell me how to do this? I didn't find anything in the documentation regarding this.
6 Answers, 1 is accepted
0
Ujjwal Lahoti
Top achievements
Rank 1
answered on 08 Apr 2010, 03:26 PM
Any answers/comments?
0
Hello Ujjwal,
RadGridView will automatically start editing on F2 and double click. If you want start editing by pressing the "Enter" key you have to write your own IKeyboardCommandProvider and implement the logic there. You can derive from our DefaultKeyboardProvider and assign your implementation to the KeyboardCommandProvider property of RadGridView.
Regards,
Stefan Dobrev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
RadGridView will automatically start editing on F2 and double click. If you want start editing by pressing the "Enter" key you have to write your own IKeyboardCommandProvider and implement the logic there. You can derive from our DefaultKeyboardProvider and assign your implementation to the KeyboardCommandProvider property of RadGridView.
Regards,
Stefan Dobrev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ujjwal Lahoti
Top achievements
Rank 1
answered on 09 Apr 2010, 03:32 PM
Thanks for the reply. Can you provide some sample code to do this?
Also, can you clarify if you can define multiple "EditTriggers" for the DataGrid? For eg. if you set Edit trigger to single click: EditTriggers="CellClick", then only one mouse click would work, F2 will not work. I was wondering if I can define something like:
EditTriggers="CellClick|F2" (this syntax doesn't work), to allow editing by mouse click or by F2.
Also, can you clarify if you can define multiple "EditTriggers" for the DataGrid? For eg. if you set Edit trigger to single click: EditTriggers="CellClick", then only one mouse click would work, F2 will not work. I was wondering if I can define something like:
EditTriggers="CellClick|F2" (this syntax doesn't work), to allow editing by mouse click or by F2.
0
Hello,
You can use this syntax instead: ... EditTriggers="CellClick,F2"...
Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
You can use this syntax instead: ... EditTriggers="CellClick,F2"...
Greetings,
Vlad
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ujjwal Lahoti
Top achievements
Rank 1
answered on 09 Apr 2010, 04:24 PM
Thanks for the quick response. The syntax works fine.
Also can you provide some code to write my own IKeyboardCommandProvider (as described in the reply from , and how to register the new class so that it appears in the property view.
Also can you provide some code to write my own IKeyboardCommandProvider (as described in the reply from , and how to register the new class so that it appears in the property view.
0
Hi Ujjwal Lahoti,
I'm attaching an example how to use IKeyboardCommandProvider interface with RadGridView. As I understand example do exact what you want. Take a look at CustomCommandProvider class and its usage.
P.S. The example is a Silverlight application, but will work for WPF too.
Sincerely yours,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I'm attaching an example how to use IKeyboardCommandProvider interface with RadGridView. As I understand example do exact what you want. Take a look at CustomCommandProvider class and its usage.
P.S. The example is a Silverlight application, but will work for WPF too.
Sincerely yours,
Nedyalko Nikolov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.