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
119
Copy contents of UltraGrid to Clipboard
posted

Can someone please help me with this.  I found on the site how to select the entire range of the grid but it didn't explain the copy part which I am equally ignorant in.

 

I want to simply press a button and have the contents of the grid on the clipboard, ready to be dropped in excel. If possible I would like  the logic to allow for the user to be able to group a number of different columns and only copy to the clipboard what is being displayed on the screen.

 

Thanks for the help.

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    Hi,

    Once you have selected the rows you want, copying to the clipboard is pretty simple. Make sure you have the grid set up to allow copying.

    So make sure you have AllowMultiCellOperations (on the Override) set to allow copying. And then you can perform a copy operation in code like so:

    this.ultraGrid1.PerformAction(UltraGridAction.Copy, false, false);

    I'm not sure what you mean about grouping and the visible rows. Do you mean you only want to copy rows that are in the visible area of the grid? You want to exclude rows that are selected, but are scrolled out of view? I don't think there is any way to do that. But you could select only the rows that are in view using the grid.ActiveRowScrollRegion.VisibleRows collection.

     

Children