Create MVC 5 Combo Box from CRM Entities?
Posted
by
SpaceCowboy74
on Stack Overflow
See other posts from Stack Overflow
or by SpaceCowboy74
Published on 2014-08-23T04:15:31Z
Indexed on
2014/08/23
4:20 UTC
Read the original article
Hit count: 118
I am working on an MVC 5 App that pulls data from Dynamics CRM 5. The Data I am getting back is an IQueryable of type Account (The CRM Entity class auto generated by CrmSvcUtil). I am retrieving all of the items and can loop through them with code like this:
@foreach (var item in Model.ToList())
{
<tr>
<td>
@item.AccountId
</td>
<td>
@Html.DisplayFor(modelItem => item.Name)
</td>
</tr>
}
The problem is, I would like to instead put them in a drop down list. I can't figure out what the syntax is to put these in a DropDown is.
Any suggestions?
© Stack Overflow or respective owner