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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Trying to handle ClipboardPaste in GDBG

Thread ID:

Created:

Updated:

Platform:

Replies:

23425 Jan 12,2005 02:29 PM UTC Jan 13,2005 08:57 AM UTC Windows Forms 4
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 12, 2005 02:29 PM UTC

I have a GDBG in which I am handling the Model.ClipboardPaste event. I used an example that was posted on these forums. My problem is that regardless of where I copy or cut the data from, the clipboard "DataObject" field in the GridCutPasteEventArgs is always null. I tried copying/cutting from within another GDBG and also from Excel. Note that I am handling the ClipboardPaste event in order to ensure that there are enough rows available to hold all the rows being pasted. The result of the paste operation in the grid itself is that only the top row of whatever I have cut or copied is pasted. Any ideas? Thanks, Andy

Administrator [Syncfusion]
Replied On January 12, 2005 04:13 PM UTC

You get the data directly from the Clipboard. IDataObject iData = Clipboard.GetDataObject(); string psz = iData.GetData(DataFormats.Text) as string;

Administrator [Syncfusion]
Replied On January 12, 2005 06:14 PM UTC

Clay, That works. It begs the question, however, of why there''s a DataObject in the parameters to the handler? Is that data object ever populated? Andy >You get the data directly from the Clipboard. > >IDataObject iData = Clipboard.GetDataObject(); >string psz = iData.GetData(DataFormats.Text) as string; >

Administrator [Syncfusion]
Replied On January 12, 2005 10:08 PM UTC

You need to use the clipboard as that is where other programs will expect to find the information and to put this information. Here is the help on that object. It is there so it can eventually be used for direct copy/paste within the same grid but that feature has not been implemented yet. /// /// The DataObject to be used for further clipboard operations. This property will only be checked by the calling /// method if you do not set to true. Can be NULL. ///

Administrator [Syncfusion]
Replied On January 13, 2005 08:57 AM UTC

I understand now. Thanks.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;