Spread WPF Documentation
Importing and Exporting CSV Files
Spread WPF Documentation > Developer's Guide > Managing Data > Importing and Exporting CSV Files

GcSpreadSheet has additional settings that are available when saving or loading CSV files. You can only save or load text, include row or column headers, save or load unformatted values, export or import formulas, and set the encoding.

You can use the OpenCsv or SaveCsv method in code.

Using Code

The following example uses the OpenCsv and SaveCsv methods to open and save a file.

CS
Copy Code
// gcSpreadSheet1.Sheets[0].SaveCsv("c:\\zipfile\\test.csv", GrapeCity.Windows.SpreadSheet.Data.TextFileSaveFlags.AsViewed);
gcSpreadSheet1.Sheets[0].OpenCsv("c:\\zipfile\\test.csv", GrapeCity.Windows.SpreadSheet.Data.TextFileOpenFlags.None);
gcSpreadSheet1.Invalidate();
VB.NET
Copy Code
'GcSpreadSheet1.Sheets(0).SaveCsv("c:\zipfile\test.csv", GrapeCity.Windows.SpreadSheet.Data.TextFileSaveFlags.AsViewed)
GcSpreadSheet1.Sheets(0).OpenCsv("c:\zipfile\test.csv", GrapeCity.Windows.SpreadSheet.Data.TextFileOpenFlags.None)
GcSpreadSheet1.Invalidate()
See Also