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

Trying to handle ClipboardPaste in GDBG

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

4 Replies

AD Administrator Syncfusion Team January 12, 2005 11:13 AM

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


AD Administrator Syncfusion Team January 12, 2005 01:14 PM

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; >


AD Administrator Syncfusion Team January 12, 2005 05:08 PM

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. ///


AD Administrator Syncfusion Team January 13, 2005 03:57 AM

I understand now. Thanks.

Loader.
Live Chat Icon For mobile
Up arrow icon