New to Telerik UI for WinForms? Start a free 30-day trial

Definition

Namespace:Telerik.WinControls.UI.Export

Assembly:TelerikData.dll

Syntax:

C#
public class ExportToCSV : IExportGridTo

Inheritance: objectExportToCSV

Implements: IExportGridTo

Constructors

Create instance of exporter class with specified RadGridView to export

C#
public ExportToCSV(RadGridView radGridView)
Parameters:radGridViewRadGridView

RadGridView to export

Properties

Gets or sets the child view export mode.

C#
public ChildViewExportMode ChildViewExportMode { get; set; }
Property Value:

The child view export mode.

Gets or sets the value that will be used for a column delimiter.

C#
public string ColumnDelimiter { get; set; }

Gets or sets a value indicating whether values are enclosed in quotes in the exported file.

C#
public bool EncloseDataWithQuotes { get; set; }

Gets or sets the encoding used for the exported file. Default encoding is UTF8.

C#
public Encoding Encoding { get; set; }

Set if child rows should be exported.

C#
public bool ExportHierarchy { get; set; }

Set file extension. Default value is csv.

C#
public string FileExtension { get; set; }

Implements: IExportGridTo.FileExtension

Set if hidden column would be exported. Note that ExportAsHidden is not relevant for CSV export.

C#
public HiddenOption HiddenColumnOption { get; set; }

Implements: IExportGridTo.HiddenColumnOption

Set if hidden rows would be exported. Note that ExportAsHidden is not relevant for CSV export.

C#
public HiddenOption HiddenRowOption { get; set; }

Implements: IExportGridTo.HiddenRowOption

Sets a value indicating how the export behavies when paging is enabled.

C#
public PagingExportOption PagingExportOption { get; set; }
Property Value:

The paging export option.

Set RadGridView that would be exported.

C#
public RadGridView RadGridViewToExport { get; set; }

Implements: IExportGridTo.RadGridViewToExport

Gets or sets the value that will be used for a row delimiter.

C#
public string RowDelimiter { get; set; }

Set how to export summary rows.

C#
public SummariesOption SummariesExportOption { get; set; }

Implements: IExportGridTo.SummariesExportOption

Methods

Add custom row in the provided csv table element

C#
public void AddCustomCSVRow(TableElement csvTableElement, params string[] cellValues)
Parameters:csvTableElementTableElement

CSV table element where the new row will be added

cellValuesstring[]

Values for the every csv cell object in the custom row

C#
protected virtual void OnChildViewExporting(ChildViewExportingEventArgs e)
Parameters:eChildViewExportingEventArgs
C#
protected virtual void OnCSVCellFormatting(CSVCellFormattingEventArgs e)
Parameters:eCSVCellFormattingEventArgs
C#
protected virtual void OnCSVTableCreated(CSVTableCreatedEventArgs e)
Parameters:eCSVTableCreatedEventArgs

Creates file in csv format.

C#
public void RunExport(string fileName)
Parameters:fileNamestring

Export file name

Implements: IExportGridTo.RunExport(string)

Events

Occurs when a child view will be exported.

C#
public event ChildViewExportingEventHandler ChildViewExporting

Fires when an csv cell was created and needs to be formatted.

C#
public event CSVCellFormattingEventHandler CSVCellFormatting

Fires when the csv table element was created.

C#
public event CSVTableCreatedEventHandler CSVTableCreated