We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

CopyTextToClipboard method

Hi There,

I am having some trouble using this method. I am trying to copy the entire contents of a GridControl derived grid, but nothing is ending up in the clipboard, and the method returns false. Here is my code. Any idea why subsequent calls to Clipboard.HasText() would return empty?

///
/// This is just a convenience for client code. Just copies the entire grid to the clipboard.
///

public void CopyGridToClipboard()
{
GridRangeInfoList list = new GridRangeInfoList();
list.Add(GridRangeInfo.Table());
bool b = CutPaste.CopyTextToClipboard(list);
}

2 Replies

AD Administrator Syncfusion Team March 22, 2007 05:03 PM UTC

Hi Aaron,

One way you can do this by using the GridRangeInfo.Cells method in a grid. Please try this code and let me know if this helps.

public void CopyGridToClipboard()
{
GridRangeInfoList list = new GridRangeInfoList();
list.Add(GridRangeInfo.Cells(0,0, Model.RowCount, Model.ColCount));
bool b = CutPaste.CopyTextToClipboard(list);
}

Best regards,
Haneef


AS Aaron Schaefer March 23, 2007 03:53 PM UTC

Thank You!

That worked as intended.

Aaron

Loader.
Live Chat Icon For mobile
Up arrow icon