Skip to main content
Row

RangeDataSourceOptions.UseFirstRowAsHeader Property

Specifies whether to use the text contained in the first row cells of the data source range as column headers.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v24.1.Core.dll

NuGet Package: DevExpress.Spreadsheet.Core

Declaration

public bool UseFirstRowAsHeader { get; set; }

Property Value

Type Description
Boolean

true, to retrieve the column names from the corresponding cells of the first row; otherwise, false.

Remarks

If any of the cells within the first row is empty, the header for the corresponding column is Column X, where X is the ordinal number of the column with empty header. If the first row contains duplicate names, an ArgumentException in thrown.

Instead of using headers to specify column names, you can implement a custom class which provides column names. Assign an instance of this class to the RangeDataSourceOptions.DataSourceColumnTypeDetector property when creating a data source.

The following code snippets (auto-collected from DevExpress Examples) contain references to the UseFirstRowAsHeader property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also