GridView.ClipboardDataProvider Property
Gets an object that provides data for the clipboard in various formats (plain text, plain unicode text, rich text, CSV, BIFF8, HTML).
Namespace: DevExpress.XtraGrid.Views.Grid
Assembly: DevExpress.XtraGrid.v24.1.dll
NuGet Packages: DevExpress.Win.Grid, DevExpress.Win.Navigation
Declaration
[DXCategory("Data")]
[Browsable(false)]
public virtual GridClipboardDataProvider ClipboardDataProvider { get; }
Property Value
Type | Description |
---|---|
GridClipboardDataProvider | An object that provides data for the clipboard in various formats (plain text, plain unicode text, rich text, CSV, BIFF8, HTML). |
Remarks
The ClipboardDataProvider
property returns a GridClipboardDataProvider class instance. This object provides data to the clipboard in various formats (plain text, rich text, plain unicode text, CSV, BIFF8, HTML). Use the provider’s methods to get data that is currently selected in the control. This data is passed to the clipboard if the user presses Ctrl+C. For example, the GridClipboardDataProvider.GetTextData method returns clipboard data in plain text format.
Example
The GridClipboardDataProvider allows you to get data that are currently selected in the grid and will be passed to the clipboard. The figure and code below show the selected rows in the control, usage of the GridClipboardDataProvider.GetCsvData method, and the returned value.
gridView1.ClipboardDataProvider.GetCsvData();
// The method returns the following value:
//
// State,Sales,Sales vs Target,Profit,Satisfaction,Market Share
// Arizona,73M,-0.94%,-4M,3.6,11%
// North Carolina,71M,-1.11%,-17M,3,12%