title: Populate Combobox in winforms (C#) from a range of column header in the dataGridView?
body: <p>im sort of stuck on how to populate a combobox with a range of headers in the dataGridView? as not all the column headers are what i want to be listed in it.
  As from the code below i am displaying the data in dataGridView from an Excel file. I  would appreciate if anyone could help me on this. Thank you.</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  using System.Data.OleDb;
  
  namespace GBstock
  {
      public partial class Form1 : Form
  {
      public Form1()
      {
          InitializeComponent();
  
          // populate the dataGridView with the Excel File //
          string connectionString = String.Format(@"Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0};Extended Properties=""Excel 8.0;HDR=YES;IMEX=1;""", @"FilePath");
          string query = String.Format("select * from [{0}$]", "Sheet1");
          OleDbDataAdapter dataAdapter = new OleDbDataAdapter(query, connectionString);
          DataSet dataSet = new DataSet();
          dataAdapter.Fill(dataSet);
          dataGridView1.DataSource = dataSet.Tables[0];
      }
  }
  </code></pre>
  
  <p>}</p>