How to display an object property in a drop down list in VB.Net/C# and ASP.NET
<p>I am working with VB.Net and ASP.net, but C# code are welcome too.</p>

<p>I have a list of Clients, the client attributes are: </p>

<p>-ClientID<br>
-FullName </p>

<p>Sample data:</p>

<p>-ClientID:1<br>
-FullName:John Binder</p>

<p>-ClientID:2<br>
-FullName:Leah Brown</p>

<p>And I have a list of Agreements "lstAgreements", their attributes are:  </p>

<p>-AgreementID<br>
-ClientID<br>
-Date</p>

<p>Sample data:</p>

<p>AgreementID:5<br>
ClientID:2<br>
Date:12/30/16  </p>

<p>AgreementID:7<br>
ClientID:1<br>
Date:12/29/16  </p>

<p>"Client" and "Agreement" are entities classes with an existing relation:One client can have many Agreements.</p>

<p>I can retrieve all the agreements with:</p>

<pre><code> Dim lstAgreements As List(Of Agreement) =GetAllAgreements()
</code></pre>

<p>And the Agreement Class has a property to get the client object:</p>

<pre><code>lstAgreements(0).ClientObject.FullName
</code></pre>

<p>Then I can populate a drop down list with "lstAgreements"</p>

<pre><code>myDropDownList.DataSource = lstAgreements 
myDropDownList.DataValueField = "AgreementID"
myDropDownList.DataTextField = "ClientID"
myDropDownList.DataBind()
</code></pre>

<p>My question is, how can I display "ClientFullName" instead "ClientID" in the drop Down List?</p>

<p>I am trying this code but it does not work:</p>

<pre><code>myDropDownList.DataSource = lstAgreements 
myDropDownList.DataValueField = "AgreementID"
myDropDownList.DataTextField = "ClientObject.FullName"
myDropDownList.DataBind()
</code></pre>

<p>I noticed that using "ClientObject.FullName" in a DataList control it works fine, but in Drop Down List it doesn't.</p>

<p>Any suggestion?</p>

<p>Thanks in advance</p>