DataGridView Column Headers from First Row of Excel DataTable

  • Thread starter Thread starter noip
  • Start date Start date
N

noip

I'm sure this is something ridiculously simple or just not possible
without custom coding:

How do I tell a DataGridView NOT to create column headers from the
first row of a data table using an Excel datasource?

All I want to do is have the first row of data from the Excel
worksheet be the first row of data in the DataGridView and NOT be the
column headers.

It would seem to be something simple to ask, but for the life of me, I
cannot find out how to do it. Even in Excel itself, it has a "first
row contains column headers" when importing data. Surely the
DataGridView should let me turn off that kind of feature?

Thanks in advance.
 
Additional information that might help:

The data adapter is an OleDbDataAdapter object using the Excel
spreadsheet.

A BindingSource's DataSource is set to the data table filled by the
adapter. Not sure I need this level, but it's there for now.

The DataGridView's datasource is set to the binding source above.

Thanks again.
 
Back
Top