title: Xceed Wpf PropertyGrid - reset SelectedItem programatically
body: <p>When I load my app Property Grid looks like this:</p>
  
  <p><a href="https://i.stack.imgur.com/EZoVA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/EZoVA.png" alt="enter image description here"></a></p>
  
  <p>Initially no item is selected. After I Select an item, it shows every property properly.</p>
  
  <p>The thing is that I need to reload my list of items, reset the selection and set Property Grid to its initial state.</p>
  
  <p><strong>The problem:</strong> Property Grid does not go back to its initial state after having SelectedObject set to null.</p>
  
  <p>Also every property has its own editor. Maybe the problem is the Instancing I am using in Bindings?</p>
  
  <p>Sample Code for Property Grid:</p>
  
  <pre><code>&lt;xctk:PropertyGrid x:Name="_propertyGrid" SelectedObject="{Binding SelectedItem.MyObject}" AutoGenerateProperties="False"&gt;
      &lt;xctk:PropertyGrid.EditorDefinitions&gt;
          &lt;xctk:EditorTemplateDefinition TargetProperties="SampleProperty"&gt;
              &lt;xctk:EditorTemplateDefinition.EditingTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBlock Text="{Binding Instance.SampleProperty, UpdateSourceTrigger=PropertyChanged}" /&gt;
                  &lt;/DataTemplate&gt;
              &lt;/xctk:EditorTemplateDefinition.EditingTemplate&gt;
          &lt;/xctk:EditorTemplateDefinition&gt;
      &lt;/xctk:PropertyGrid.EditorDefinitions&gt;
  
      &lt;xctk:PropertyGrid.PropertyDefinitions&gt;
          &lt;xctk:PropertyDefinition TargetProperties="SampleProperty"/&gt;
      &lt;/xctk:PropertyGrid.PropertyDefinitions&gt;
  &lt;/xctk:PropertyGrid&gt;
  </code></pre>
  
  <p>Ways I tried to reset Property Grid:</p>
  
  <pre><code>    _propertyGrid.SelectedObject = null;
      if (SelectedItem != null)
              SelectedItem.MyObject = null;
      SelectedItem = null;
      _propertyGrid.Update();
  </code></pre>