Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
285
How To Copy Grid Column Data
posted

I have a WinGrid with several columns. Each column has a header and the grid has several rows. When a user clicks on the column header I have code the changes the background color to indicate the column was selected. I also have a right click popup menu defined.

When a user right clicks on the column header, I want to copy the entire column, header and data, so the data can paste into Excel. But this isn't working. I can see the column in the Selected.Columns collection, but nothing on the clipboard.

Any suggestions or exmaple links? Thanks.

Parents
No Data
Reply
  • 27093
    posted

    Hello,

    There is a suitable event in the grid - DoubleClickHEader and you'll need a variable of type UltraGridColumn to store the copied column:

     

    private void ultrGrid1_DoubleClickHeader(object sender, DoubleClickHeaderEventArgs e)

    {

          UltraGridColumn copiedColumn = e.Header.Column;

    }

     

    Hope this helps.

     

    Sincerely,

    Petar Monov

    Developer Support Engineer,

    Infragistics, Inc

     

Children