Class GridCSVConverter
Provides the functionalities for exporting the grid to CSV file.
Inheritance
Inherited Members
Namespace: Syncfusion.GridHelperClasses
Assembly: Syncfusion.GridHelperClasses.Windows.dll
Syntax
public class GridCSVConverter
Constructors
GridCSVConverter()
Initializes a new instance of the GridCSVConverter class.
Declaration
public GridCSVConverter()
Methods
ExportRange(GridRangeInfo, GridModel, String)
Exports specified range to excel from GridModel object passed in.
Declaration
public void ExportRange(GridRangeInfo range, GridModel grid, string filename)
Parameters
Type | Name | Description |
---|---|---|
GridRangeInfo | range | Range of type GridRangeInfo to be exported. |
GridModel | grid | The grid model. |
System.String | filename | Name of the file to which the grid is to be exported. |
Examples
This example shows how to export the range to CSV format.
GridCSVConverter csvConverter = new GridCSVConverter();
GridRangeInfo range = GridRangeInfo.Rows(1, 5);
csvConverter.ExportRange(range, this.gridGroupingControl1.TableModel, "Sample.csv");
Dim csvConverter As GridCSVConverter = New GridCSVConverter
Dim range As GridRangeInfo = GridRangeInfo.Rows(1, 5)
csvConverter.ExportRange(range, Me.gridGroupingControl1.TableModel, "Sample.csv")
GridToCSV(GridControlBase, String)
Converts grid into csv file.
Declaration
public void GridToCSV(GridControlBase grid, string fileName)
Parameters
Type | Name | Description |
---|---|---|
GridControlBase | grid | Grid to export. |
System.String | fileName | Name of the file to which the grid is to be exported. |
GridToCSV(GridModel, Int32, Int32, Int32, Int32, String)
Exports the grid model to CSV file.
Declaration
public void GridToCSV(GridModel grid, int startcolindex, int startrowindex, int rowcount, int colcount, string fileName)
Parameters
Type | Name | Description |
---|---|---|
GridModel | grid | The grid model. |
System.Int32 | startcolindex | Starting column index from which the grid has to be exported |
System.Int32 | startrowindex | Starting row index from which the grid has to be exported |
System.Int32 | rowcount | Total rows to be exported |
System.Int32 | colcount | Total columns to be exported |
System.String | fileName | Name of the file to which the grid is to be exported. |
GridToCSV(GridModel, String)
Exports the grid model into CSV file.
Declaration
public void GridToCSV(GridModel grid, string fileName)
Parameters
Type | Name | Description |
---|---|---|
GridModel | grid | Grid to export. |
System.String | fileName | Name of the file to which the grid is to be exported. |
SelectedExport(GridModel, String)
Exports selected range from grid model passed in.
Declaration
public void SelectedExport(GridModel grid, string FileName)
Parameters
Type | Name | Description |
---|---|---|
GridModel | grid | The grid model. |
System.String | FileName | Name of the file to which the grid is to be exported. |