title: VSTO Excel: How to make a custom column mapping with ListObject?
body: <p>I have a model like this:</p>
  
  <pre><code>public class Instrument
  {
      public string Id { get; set; }
      public string Name { get; set; }
  
      // About 100 other properties
  }
  </code></pre>
  
  <p>And I retrieve Instrument instances from an Entity Framework EDM.</p>
  
  <p>Now what I would like to do is to be able to make a custom mapping to bind this dataset to a Excel ListObject. By default, ListObject will display every column in the Excel worksheet but I only want to show some properties and in a particular order.</p>
  
  <pre><code>ExcelTools.ListObject instrumentsTable = this.Controls.AddListObject(tableStart, tableName);
  instrumentsTable.DataSource = myEDM.Instruments;
  
  // Custom mapping code...
  </code></pre>
  
  <p>I tried to use the SetDataBinding method but it was throwing a data binding exception.</p>
  
  <p>Do anybody can help me achieving that?</p>
  
  <p>Thanks.</p>