DataGridView Column Headers from First Row of Excel DataTable



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.

Just Me

Additional information that might help:

The data adapter is an OleDbDataAdapter object using the Excel

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.

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question