This is a migrated thread and some comments may be shown as answers.
CopyingCellClipboardContent isn't raised
1 Answer 6 Views
This is a migrated thread and some comments may be shown as answers.
Terry Humphries
Top achievements
Rank 2
Terry Humphries asked on 06 May 2014, 05:38 PM
When a column has the EditTriggers ptoperty set to CellClick the CopyingCellClipboardContent isn't raised.

1 Answer, 1 is accepted

Sort by
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 to attach 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);
         
        }
 
        private void CommandExecuted(object sender, RoutedEventArgs e)
        {
            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.
 
Asked by
Terry Humphries
Top achievements
Rank 2
Answers by
Boris
Telerik team
Share this question
or