| True DBGrid for WinForms Task-Based Help > Exporting Grid Data > Exporting to Delimited Text |
To set the ExportToDelimitedFile method, add the following code to the Click event of the Export button:
To write code in Visual Basic
| Visual Basic |
Copy Code
|
|---|---|
Me.C1TrueDBGrid1.ExportToDelimitedFile("c:\temp\composers.csv", C1.Win.C1TrueDBGrid.RowSelectorEnum.AllRows, ",")
|
|
To write code in C#
| C# |
Copy Code
|
|---|---|
this.c1TrueDBGrid1.ExportToDelimitedFile(@"c:\temp\composers.csv", C1.Win.C1TrueDBGrid.RowSelectorEnum.AllRows, ","); |
|
![]() |
Note: C1TrueDBGrid's export feature uses Reports for WinForms' components internally, and you may need to reference Reports for WinForms' assemblies (C1.Win.C1Report and C1.C1Report) if you are receiving an error related to the assembly. |
Clicking the Export button creates a delimited text file in the temp directory specified in the code above. Each value in the file is separated by a comma: