Disable copy functionality in TreeListView

3 posts, 0 answers
  1. Larry
    Larry avatar
    2 posts
    Member since:
    Mar 2012

    Posted 09 Mar 2012 Link to this post

    When I select an item in a RadTreeListView, press CTRL+C to copy, and paste into notepad, the results suggest to me that what the control is actually doing is calling the list item's ToString() method and placing the string result on the clipboard. The objects we display in our list view do not override ToString(), so the copied result is the return value from Object.ToString(), which is the name of the type.

    Since we can't come up with a useful string representation of the objects we display, we'd rather just disable the copy operation, rather than have it put some not-very-useful string on the clipboard. Is there a way to do this?

    Thanks,
    Larry
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 12 Mar 2012 Link to this post

    Hello Larry,

    You can cancel Copying event of the grid like so:

    private void clubsGrid_Copying(object sender, Telerik.Windows.Controls.GridViewClipboardEventArgs e)
            {
                e.Cancel = true;
            }

    All the best,
    Didie
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. Larry
    Larry avatar
    2 posts
    Member since:
    Mar 2012

    Posted 12 Mar 2012 Link to this post

    Thank you!
Back to Top