tags:

views:

66

answers:

1

Hi there, I'm using Entity Framework and I want to bind a list of one of them to a dropdownlist. This is working well. But there's just one problem. What is the best practice to go to an outter object linked to the entity listed?

I.E: A command which have ID, date, refCandidatID, etc. and for some reason, on my dropdownlist, i want to show the firstname of my candidat

<asp:DropDownList ID="ddlCommand" runat="server" DataTextField="Candidat.FirstName" DataValueField="ID" AppendDataBoundItems="true" />

What should i do cuz it keeps throwing me an error when binding the Dropdownlist.

Note : Sorry for my english.

A: 

The only solution I saw is to make another object such as "MyListItem" and my facade return a list of MyListItem previously feeded with ValueField = CommandID and TextField = Candidat.FirstName. Is there any other solution?

Simon