Issue while Copying Content From RadGridView

2 posts, 0 answers
  1. Vasista
    Vasista avatar
    1 posts
    Member since:
    May 2013

    Posted 05 May 2014 Link to this post


    We're facing an issue while copying content from RadGridView to Excel.
    Our RadGridView has a GridViewSelectColumn as first column, which must be ignored while copying.
    When we select rows and copy the content, we are getting the first column header as 'System.Windows.Controls.CheckBox Content: IsChecked:False'

    To eleminate this, we've placed the below work-arround for supressing the column from being copied:

    Dim checkBoxColumn = CType(sender, RadGridView).Columns("CheckBoxColumn")
    If checkBoxColumn IsNot Nothing AndAlso originalText.Contains(checkBoxColumn.Header.ToString) Then
        updatedText = originalText.Replace(checkBoxColumn.Header.ToString, String.Empty)
    End If

    Using the above logic, we're able to clear the content from being copied but, we're getting the cell in the copied content.
    That is, when pasted in excel, the first column being pasted with empty header and empty cell contents.

    Please help us to eleminate the complete column from getting copied.

    There is a similar issue with ignoring columns while pasting back from Excel to RadGridView

  2. Vera
    Vera avatar
    263 posts

    Posted 05 May 2014 Link to this post

    Hi Vasista,

    I would suggest you to check RadGridView Copy paste functionality example available in our SDK browser. It demonstrates how to copy a row by excluding GridViewSelectColumn.
    Please download the SDK browser so you can test the project locally on your side.

    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