In This Topic
To set the ExportToDelimitedFile method, add the following code to the Click event of the Export button:
C# |
Copy Code
|
private void button1_Click(object sender, EventArgs e)
{
c1TrueDBGrid1.ExportToDelimitedFile(@"c:\temp\composers.csv", C1.Win.C1TrueDBGrid.RowSelectorEnum.AllRows, ",");
}
|
Note:
TrueDBGrid's export and printing features uses the
C1.Win.Printing NuGet package, which provides three libraries: C1.PrintDocument, C1.Win.PrintPreview and C1.Win.RibbonPreview. Each library provides a set of previewing controls or components. The
PrintDocument library provides the PrintDocument and MultiDocument components, the
PrintPreview library provides the PreviewOutlineView, PreviewPane, PreviewTextSearchPanel, Thumbnail, PrintPreviewControl and PrintPreviewDialog components, and
RibbonPreview provides the RibbonPreview and RibbonPreviewDialog components. Since C1Report is now obsolete, make sure that the references for C1Report libraries is replaced by individual library references in the C1.Win.Printing nuget.
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: