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
875
Copying an entire grid to the clipboard
posted

I have an application that contains UltrawinGrids and UltraWinCharts.  I am able to copy the chart to the clipboard (using the built in chart method) so that my users can paste the results into persentations.  Does the WinGrid have something similar to this functionality?

I know that you can export the entire grid to Excel or to a PDF, but I didn't know if there was a way to send an image of the grid to the clipboard.  There are ways to do screen captures using some .Net graphics code, but that will only grab the viewable area and not the data that is scrolled.

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    Hi,

    There's nothing built-in to the grid for this.

    You could do something similar to how the grid prints. Basically, the way printing works is that the grid will take sort've screen shots of itself and then scroll a page, then take another image.

    So you could use the grid's UIElements for this. Basically, you would scroll to the top of the grid using grid.ActiveScrollRegion.FirstRow.

    Then you could get the RowColRegionIntersectionUIElement using grid.DisplayLayout.UIElement.GetDescendant.

    You could then call the DrawElement method to draw that UIElement (which contains all the rows visible in the grid) onto a BitMap. Then you could scroll down a page and do it again.

    There will be some tricky parts. For one thing, the grid will have to be wide enough so that all of the columns are visible. And you might have to work on merging the images together, since there might be a partial row visible at the bottom of the grid. But it seems like it should be possible with a little work.

Children
No Data