When a column has the EditTriggers ptoperty set to CellClick the CopyingCellClipboardContent isn't raised.
1 Answer, 1 is accepted
0
Boris
Telerik team
answered on 07 May 2014, 01:51 PM
Hello David,
This is expected. When the EditTriggers property is set to CellClick and you click on the cell it enters edit mode. That is why you can not use the CopyingCellClipboardContent event. When the GridViewDataColumn cell is in edit mode the default editor for it is a TextBox. This means that the copying event is handled by the WPF TextBox element and not the GridView. A possible approach is toattach to RoutedEvent to the Window and handle the ExecutetedEvent of the CommandManager and then check if the execute command is an ApplicationCommands.Copy.
public MainWindow()
{
InitializeComponent();
this.AddHandler(CommandManager.ExecutedEvent, new RoutedEventHandler(CommandExecuted), true);
if ((e as ExecutedRoutedEventArgs).Command == ApplicationCommands.Copy)
{
}
}
Please let us know if this helps.
Regards,
Boris Penev
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.