Class
DataTableFormatProvider

Converts between ADO.NET DataTable instances and spreadsheet workbooks, enabling bidirectional data exchange for tabular data integration.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.FormatProviders

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

cs-api-definition
public class DataTableFormatProvider

Inheritance: objectDataTableFormatProvider

Constructors

DataTableFormatProvider()

Initializes a new instance of the DataTableFormatProvider class with default import and export settings.

Declaration

cs-api-definition
public DataTableFormatProvider()

Properties

ExportSettings

Gets or sets the settings controlling how worksheet data is exported to DataTable.

Declaration

cs-api-definition
public DataTableFormatProviderExportSettings ExportSettings { get; set; }

Property Value

DataTableFormatProviderExportSettings

ImportSettings

Gets or sets the settings controlling how DataTable data is imported into worksheets.

Declaration

cs-api-definition
public DataTableFormatProviderImportSettings ImportSettings { get; set; }

Property Value

DataTableFormatProviderImportSettings

Methods

Export(Worksheet)

Exports the specified worksheet to a new DataTable, converting cell values and types according to export settings.

Declaration

cs-api-definition
public DataTable Export(Worksheet worksheet)

Parameters

worksheet

Worksheet

The worksheet for export.

Returns

DataTable

the converted DataTable

Import(DataTable)

Imports the specified DataTable into a new workbook, creating a worksheet with the table data.

Declaration

cs-api-definition
public Workbook Import(DataTable table)

Parameters

table

DataTable

The DataTable for import.

Returns

Workbook

the converted new Workbook.

Import(DataTable, Worksheet)

Imports the specified DataTable into an existing worksheet, appending data at the configured start position.

Declaration

cs-api-definition
public void Import(DataTable table, Worksheet worksheet)

Parameters

table

DataTable

The DataTable for import.

worksheet

Worksheet

The Worksheet where the data should be added.