title: How to bind the ASP.NET drop down list DataTextField property to a nested property
body: <p>I want to bind the <code>DataTextField</code> property of a ASP.NET drop down control to a property of an object that is a property of the initial data source.  How would I accomplish that particular task.</p>
  
  <p>Drop down data source data schema</p>
  
  <pre><code>public class A
  {
     public string ID { get; set; }
     public B { get; set; }
  } 
  
  public class B
  {
     public string Name { get; set; }  //want to bind the DataTextField to this property
  }
  </code></pre>
  
  <p>ASP.NET code behind</p>
  
  <pre><code>DropDownList MyDropDownList = new DropDownList();
  List&lt;A&gt; MyList = GetList();
  
  MyDropDownList.DataSource = MyList;
  MyDropDownList.DataValueField = "ID";
  </code></pre>