Available for: UI for ASP.NET Core | UI for ASP.NET MVC | UI for ASP.NET AJAX | UI for Blazor | UI for WPF | UI for WinForms | UI for Silverlight | UI for Xamarin


CsvFormatProvider allows to import and export CSV documents. Additionally, there are a number of settings that allow you to modify the import/export. The current article outlines the available settings.

CsvFormatProvider exposes a Settings property of type CsvSettings. This allows you to specify the following:

  • Delimiter: Gets or sets the list separator. By default the CsvFormatProvider class imports and exports files using the list separator specified by the current culture of the system.

  • Quote: Gets or sets the quote symbol

  • HasHeaderRow: Specifies whether the document has a header row. The default value is false.

  • Encoding: Gets or sets the Encoding that is used when exporting the file. The default value is UTF8 BOM.

Example 1 shows how to create and specify a particular setting to a CsvFormatProvider.

Example 1: Use CsvSettings

CsvFormatProvider provider = new CsvFormatProvider(); 
provider.Settings.Delimiter = ';'; 
provider.Settings.Quote = '^'; 
provider.Settings.HasHeaderRow = true; 
provider.Settings.Encoding = new UTF8Encoding(); 
In this article
Not finding the help you need? Improve this article