title: Hide a Column from a DataGrid when the ItemSource is an Observable Collection
body: <p>I have a <code>DataGrid</code> where the <code>ItemSource</code> is an Observable Collection bound using <code>MVVM</code> archetype. I would like to not show the ID property of the class displayed in my <code>DataGrid</code> however I still need the property to exist.</p>
  
  <p><strong>My Code:</strong></p>
  
  <p>XAML</p>
  
  <pre><code>&lt;DataGrid ItemsSource="{Binding MyData}" IsReadOnly="True" Name="dtSearch" /&gt;
  </code></pre>
  
  <p>View Model</p>
  
  <pre><code>    private ObservableCollection&lt;MyDataClass&gt; myData;
      public ObservableCollection&lt;MyDataClass&gt; MyData
      {
          get { return myData; }
          set
          {
              myData= value;
              RaisePropertyChanged("MyData");
          }
      }
  </code></pre>
  
  <p>Observable Class</p>
  
  <pre><code>public partial class MyDataClass
  {
      public int ID { get; set; }
      public string Code { get; set; }
      public string Name { get; set; }
      public string Type { get; set; }
  }
  </code></pre>
  
  <p>Is there an attribute I can give my ID property to hide it from the <code>DataGrid</code>?</p>
  
  <p>Do I need to create another class for visible properties?</p>