title: WPF DataGrid doesn't generate columns for ICustomTypeDescriptor Properties (but Winforms DataGridView does)
body: <p>As in the title, I have a DataGrid and a ViewModel that implements ICustomTypeDescriptor, adding a few properties at runtime.</p>
  
  <pre><code>public class PartCloneSettingsController : BaseController, ICustomTypeDescriptor
  { 
  ...
      private List&lt;StringPropertyDescriptor&gt; generatedProperties; 
  
      private void generateProperties()
      {
          foreach (PartAttributeDefinition item in PartAttributes.DefinedAttributes)
          {
              var propertyDescriptor = new StringPropertyDescriptor(item.AttributeTitle, typeof(PartCloneSettingsController), item);
  
              // attach value changed handler [ memory leak? TODO: Remove handler at some point...]
              propertyDescriptor.AddValueChanged(this, OnGeneratedPropertyChanged);
              generatedProperties.Add(propertyDescriptor);
          }
      }
  
  
      public PropertyDescriptorCollection GetProperties()
      {
          // Get All Default (defined) properties
          var properties = TypeDescriptor.GetProperties(this, true);
  
          // concat default properties and generated properties into a single collection
          var newProperties = new PropertyDescriptorCollection(properties.Cast&lt;PropertyDescriptor&gt;().Concat(generatedProperties).ToArray());
  
          return newProperties;
      }
  
  }
  </code></pre>
  
  <p>DataGrid Definition in XAML:</p>
  
  <pre><code>&lt;DataGrid x:Name="dataGrid" AutoGenerateColumns="True"  /&gt;
  </code></pre>
  
  <p>I set the ItemsSource like this:</p>
  
  <pre><code>controller.LoadAssembly(ofd.FileName); // loads the file and creates a ObservableCollection of PartCloneSettingsControllers...
  
  // set data grid source, doesn't create columns for generated properties...
  overviewGrid.ItemsSource = controller.PartCloneSettingsControllers
  
   // set data source from a winforms DataGridView which generates columns properly...
  ((System.Windows.Forms.DataGridView)wfhost.Child).DataSource =   controller.PartCloneSettingsControllers;
  </code></pre>
  
  <p>where <code>controller.PartCloneSettingsControllers</code> is defined as:</p>
  
  <pre><code>public ObservableCollection&lt;PartCloneSettingsController&gt; PartCloneSettingsControllers {  get; private set; }
  </code></pre>
  
  <p>For debugging purposes I created a DataGridView in a Winforms control host and attached the same ViewModel to it, and voila: The Winforms grid creates all columns and displays the data as I want it, but the WPF DataGrid fails to generate columns for my custom properties ( it works with plain, normal properties).</p>
  
  <p>Does anybody have a working solution using a DataGrid, ICustomTypeDescriptor and AutoGenerateColumns=True (if I generate the columns by hand in XAML it works fine, and I can bind to all my properties...)</p>