CopyingCellClipboardContent isn't raised

2 posts, 0 answers
  1. Terry Humphries
    Terry Humphries avatar
    1 posts
    Member since:
    Mar 2010

    Posted 06 May 2014 Link to this post

    When a column has the EditTriggers ptoperty set to CellClick the CopyingCellClipboardContent isn't raised.
  2. Boris
    Boris avatar
    276 posts

    Posted 07 May 2014 Link to this post

    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()
                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.

    Boris Penev
    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.
Back to Top