Class GridViewSpreadExport
GridViewSpreadExport is a powerful exporting API, allowing to export RadGridView to XLSX, PDF, CSV, and TXT format, utilizing the Document Processing Libraries.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.Export
Assembly: Telerik.WinControls.GridView.dll
Syntax
public class GridViewSpreadExport
Constructors
GridViewSpreadExport(RadGridView)
Initializes a new instance of the GridViewSpreadExport class.
Declaration
public GridViewSpreadExport(RadGridView radGridView)
Parameters
|
RadGridView
radGridView
The grid to export. |
GridViewSpreadExport(RadGridView, SpreadExportFormat)
Initializes a new instance of the GridViewSpreadExport class.
Declaration
public GridViewSpreadExport(RadGridView radGridView, SpreadExportFormat spreadExportFormat)
Parameters
|
RadGridView
radGridView
The grid to export. |
|
SpreadExportFormat
spreadExportFormat
The spread export format. |
Properties
ChildViewExportMode
Gets or sets the child view export mode.
Declaration
public ChildViewExportMode ChildViewExportMode { get; set; }
Property Value
|
ChildViewExportMode
The child view export mode. |
ExportChildRowsGrouped
Gets or sets a value indicating whether to export hierarchy and group child rows grouped.
Declaration
public bool ExportChildRowsGrouped { get; set; }
Property Value
|
System.Boolean
|
ExportFormat
Gets or sets the format of the exported file - XLSX, PDF, CSV, TXT or XLS.
Declaration
public SpreadExportFormat ExportFormat { get; set; }
Property Value
|
SpreadExportFormat
The file extension. |
ExportGroupedColumns
Gets or sets a value indicating whether to export grouped columns.
Declaration
public bool ExportGroupedColumns { get; set; }
Property Value
|
System.Boolean
|
ExportHierarchy
Gets or set if child rows should be exported.
Declaration
public bool ExportHierarchy { get; set; }
Property Value
|
System.Boolean
|
ExportViewDefinition
Gets or sets a value indicating whether to export view definition. Note that if using
RunExportAsync method to export, the view definition will not be exported.
Declaration
public bool ExportViewDefinition { get; set; }
Property Value
|
System.Boolean
|
ExportVisualSettings
Gets or sets a value indicating whether the visual settings should be exported. Note that if using
RunExportAsync method to export, the visual settings will not be exported.
Declaration
public bool ExportVisualSettings { get; set; }
Property Value
|
System.Boolean
|
FileExportMode
Specifies how the file will be exported: as a new file, a new sheet in existing file or will override a sheet with given name.
Declaration
public FileExportMode FileExportMode { get; set; }
Property Value
|
FileExportMode
NewSheetInExistingFile - will add a new sheet to the specified file, if it exists CreateOrOverrideFile - will create/override the specified file CreateOrOverrideSheet - will create/override the specified sheet |
FreezeHeaderRow
Gets or sets a value indicating whether to freeze the header row in the exported file.
Declaration
public bool FreezeHeaderRow { get; set; }
Property Value
|
System.Boolean
|
FreezePinnedColumns
Gets or sets a value indicating whether to freeze pinned columns.
Declaration
public bool FreezePinnedColumns { get; set; }
Property Value
|
System.Boolean
|
FreezePinnedRows
Gets or sets a value indicating whether to freeze pinned rows.
Declaration
public bool FreezePinnedRows { get; set; }
Property Value
|
System.Boolean
|
HiddenColumnOption
Gets or sets a value indicating how hidden columns are exported.
Declaration
public HiddenOption HiddenColumnOption { get; set; }
Property Value
|
HiddenOption
The hidden column option. |
HiddenRowOption
Gets or sets a value indicating how hidden rows are exported.
Declaration
public HiddenOption HiddenRowOption { get; set; }
Property Value
|
HiddenOption
The hidden row option. |
PagingExportOption
Gets or sets a value indicating how the export behaves when paging is enabled.
Declaration
public PagingExportOption PagingExportOption { get; set; }
Property Value
|
PagingExportOption
The paging export option. |
RadGridViewToExport
Gets or sets the RadGridView to export.
Declaration
public RadGridView RadGridViewToExport { get; set; }
Property Value
|
RadGridView
The RadGridView to export. |
SheetMaxRows
Gets or sets the maximum number of rows per sheet.
Declaration
[CLSCompliant(false)]
public ExcelMaxRows SheetMaxRows { get; set; }
Property Value
|
ExcelMaxRows
The sheet max rows. |
SheetName
Gets or sets the name of the sheet.
Declaration
public string SheetName { get; set; }
Property Value
|
System.String
The name of the sheet. |
SummariesExportOption
Gets or sets a value indicating how summary rows are exported.
Declaration
public SummariesOption SummariesExportOption { get; set; }
Property Value
|
SummariesOption
The summaries export option. |
Methods
AddSparkImage(GridViewRowInfo, GridViewSparklineColumn, Int32, Int32, Int32, Point)
Declaration
protected virtual void AddSparkImage(GridViewRowInfo gridViewRowInfo, GridViewSparklineColumn sparklineColumn, int rowIndex, int columnIndex, int skippedCells, Point imageOffset)
Parameters
|
GridViewRowInfo
gridViewRowInfo
|
|
GridViewSparklineColumn
sparklineColumn
|
|
System.Int32
rowIndex
|
|
System.Int32
columnIndex
|
|
System.Int32
skippedCells
|
|
System.Drawing.Point
imageOffset
|
CancelExportAsync()
Cancels an asynchronous export operation.
Declaration
public void CancelExportAsync()
CreateTraverser()
DetachSparkElemnt()
Declaration
protected virtual void DetachSparkElemnt()
GetSparkImage(GridViewRowInfo, GridViewSparklineColumn, Int32, Int32)
Declaration
protected virtual Image GetSparkImage(GridViewRowInfo gridViewRowInfo, GridViewSparklineColumn sparklineColumn, int width, int height)
Parameters
|
GridViewRowInfo
gridViewRowInfo
|
|
GridViewSparklineColumn
sparklineColumn
|
|
System.Int32
width
|
|
System.Int32
height
|
Returns
|
System.Drawing.Image
|
OnAsyncExportCompleted(AsyncCompletedEventArgs)
Raises the AsyncExportCompleted event.
Declaration
protected virtual void OnAsyncExportCompleted(AsyncCompletedEventArgs e)
Parameters
|
System.ComponentModel.AsyncCompletedEventArgs
e
The System.ComponentModel.AsyncCompletedEventArgs instance containing the event data. |
OnAsyncExportProgressChanged(ProgressChangedEventArgs)
Raises the AsyncExportProgressChanged event.
Declaration
protected virtual void OnAsyncExportProgressChanged(ProgressChangedEventArgs e)
Parameters
|
System.ComponentModel.ProgressChangedEventArgs
e
The System.ComponentModel.ProgressChangedEventArgs instance containing the event data. |
OnCellFormatting(CellFormattingEventArgs)
Raises the CellFormatting event.
Declaration
protected virtual void OnCellFormatting(CellFormattingEventArgs e)
Parameters
|
CellFormattingEventArgs
e
The CellFormattingEventArgs instance containing the event data. |
OnChildViewExporting(ChildViewExportingEventArgs)
Raises the ChildViewExporting event.
Declaration
protected virtual void OnChildViewExporting(ChildViewExportingEventArgs e)
Parameters
|
ChildViewExportingEventArgs
e
The ChildViewExportingEventArgs instance containing the event data. |
OnExportCompleted(EventArgs)
Raises the ExportCompleted event.
Declaration
protected virtual void OnExportCompleted(EventArgs e)
Parameters
|
System.EventArgs
e
The System.EventArgs instance containing the event data. |
RunExport(Stream, ISpreadExportRenderer)
Starts an export operation.
Declaration
public void RunExport(Stream exportStream, ISpreadExportRenderer exportRenderer)
Parameters
|
System.IO.Stream
exportStream
The stream where data will be exported. |
|
ISpreadExportRenderer
exportRenderer
|
RunExport(Stream, ISpreadExportRenderer, String)
Starts an export operation, in the specified sheet. If such sheet does not exist, it gets created.
Declaration
public void RunExport(Stream exportStream, ISpreadExportRenderer exportRenderer, string sheetName)
Parameters
|
System.IO.Stream
exportStream
The stream where data will be exported. |
|
ISpreadExportRenderer
exportRenderer
|
|
System.String
sheetName
Name of the sheet. |
RunExport(String, ISpreadExportRenderer)
Starts an export operation.
Declaration
[SecurityCritical]
public void RunExport(string fileName, ISpreadExportRenderer exportRenderer)
Parameters
|
System.String
fileName
The file name where data will be exported. |
|
ISpreadExportRenderer
exportRenderer
|
RunExport(String, ISpreadExportRenderer, String)
Starts an export operation, in the specified sheet. If such sheet does not exist, it gets created.
Declaration
public void RunExport(string fileName, ISpreadExportRenderer exportRenderer, string sheetName)
Parameters
|
System.String
fileName
The file name where data will be exported. |
|
ISpreadExportRenderer
exportRenderer
|
|
System.String
sheetName
Name of the sheet. |
RunExportAsync(Stream, ISpreadExportRenderer)
Starts an export operation that runs in a background thread.
Declaration
public void RunExportAsync(Stream exportStream, ISpreadExportRenderer exportRenderer)
Parameters
|
System.IO.Stream
exportStream
The stream where data will be exported. |
|
ISpreadExportRenderer
exportRenderer
Instance of ISpreadExportRenderer class. |
RunExportAsync(Stream, ISpreadExportRenderer, String)
Starts an async export operation, in the specified sheet. If such sheet does not exist, it gets created.
Declaration
public void RunExportAsync(Stream exportStream, ISpreadExportRenderer exportRenderer, string sheetName)
Parameters
|
System.IO.Stream
exportStream
The stream where data will be exported. |
|
ISpreadExportRenderer
exportRenderer
|
|
System.String
sheetName
Name of the sheet. |
RunExportAsync(String, ISpreadExportRenderer)
Starts an export operation that runs in a background thread.
Declaration
public void RunExportAsync(string fileName, ISpreadExportRenderer exportRenderer)
Parameters
|
System.String
fileName
The file name where data will be exported. |
|
ISpreadExportRenderer
exportRenderer
Instance of ISpreadExportRenderer class. |
RunExportAsync(String, ISpreadExportRenderer, String)
Starts an async export operation, in the specified sheet. If such sheet does not exist, it gets created.
Declaration
public void RunExportAsync(string fileName, ISpreadExportRenderer exportRenderer, string sheetName)
Parameters
|
System.String
fileName
The file name where data will be exported. |
|
ISpreadExportRenderer
exportRenderer
|
|
System.String
sheetName
Name of the sheet. |
Events
AsyncExportCompleted
Occurs when an async export operation is completed.
Declaration
public event AsyncCompletedEventHandler AsyncExportCompleted
Event Type
|
System.ComponentModel.AsyncCompletedEventHandler
|
AsyncExportProgressChanged
Occurs when the progress of an async export operation changes.
Declaration
public event ProgressChangedEventHandler AsyncExportProgressChanged
Event Type
|
System.ComponentModel.ProgressChangedEventHandler
|
CellFormatting
Occurs for every cell that is being exported.
Declaration
public event CellFormattingEventHandler CellFormatting
Event Type
|
CellFormattingEventHandler
|
ChildViewExporting
Occurs when a child view will be exported.
Declaration
public event ChildViewExportingEventHandler ChildViewExporting
Event Type
|
ChildViewExportingEventHandler
|
ExportCompleted
Occurs when the export process completes.
Declaration
public event EventHandler ExportCompleted
Event Type
|
System.EventHandler
|