title: How do you bind a gridview column to a subclass value?
body: <p>I have a ASP.net gridview that I am trying bind to.  My DataSource has a collection and 2 of the columns I am binding to are part of a subclass.  My DataSource has a subclass called Staff the contains the staff information.  The boundfields SurveyID and NumberOfExceptions bind fine, but the Staff.Name and Staff.Office cannot be bound.<br></p>
  
  <pre><code>asp:BoundField DataField="SurveyID" HeaderText="ID" ...
  asp:BoundField DataField="Staff.Name" HeaderText="Name" ...
  asp:BoundField DataField="Staff.Office" HeaderText="Office" ...
  asp:BoundField DataField="NumberOfExceptions" HeaderText="Exceptions" ...
  </code></pre>
  
  <p>And the code behind is:</p>
  
  <pre><code>uxSurveyGrid.DataSource = searchResults;
  uxSurveyGrid.DataBind();
  </code></pre>
  
  <p>If I type <code>searchResults[0].Staff.Name</code> in the code behind I can see the value, why is the runtime not being able to evaluate Staff.Name in the gridview?</p>
  
  <p>How do you bind the columns to the subclass values?  Do I have to do it in codebehind?</p>
  
  <p>Any help would be appreciated,</p>
  
  <p>Mark.</p>