title: How to set selected item of property grid
body: <p>I need to set the selected item of my property grid. I'm getting an eventargs, which stores a string (this string tells me what property in my propertygrid the user wants to select).
  The problem is i cannot find a collection of grid items, i can select one from. And also i dont know how to properly create a new GridItem object and set the <code>SelectedGridItem</code> property. </p>
  
  <pre><code>GridItem gridItem = ???;
  detailsPropertyGrid.SelectedGridItem = gridItem;
  </code></pre>
  
  <p>thank you for your help.</p>
  
  <p>Edit:</p>
  
  <p>Its almost working now tahnk you VERY much.</p>
  
  <pre><code>GridItem gi = this.detailsPropertyGrid.EnumerateAllItems().First((item) =&gt;
                  item.PropertyDescriptor != null &amp;&amp;
                  item.PropertyDescriptor.Name == colName);
          this.detailsPropertyGrid.SelectedGridItem = gi;
          this.detailsPropertyGrid.Select();
  </code></pre>
  
  <p>The only problem is: Now its selecting the Property Name field. Can I set the focus to the input field of the property?</p>