This question is locked. New answers and comments are not allowed.
Hopefully this will have a simple answer.
Using MVC3, I am passing a simple list of POCO objects as a model to my view:
<pre><code>public partial class PeopleAddress{ public int Id { get; set; } public string Address1 { get; set; } public string Address2 { get; set; } public string City { get; set; } public string State { get; set; } public string Zip { get; set; } public int PersonId { get; set; } public virtual Person Person { get; set; }}</code></pre>I use the PeopleId as the FK property to the Person entity, and the Person navigational property to navigate to the object. Here is my controller for the view:
<pre><code>public ViewResult Index() { var peopleaddresses = db.PeopleAddresses.Include("Person"); return View(peopleaddresses.ToList()); }</code></pre>Pretty trivial. I add the columns to the grid and normal edit modes, etc in the view, but for the PersonId property.
QUESTION ABOUT COLUMNS: How can I get the select (normal) mode to display the model.Person.Name, but keep the edit mode on editing model.PersonId? For model binding purposes, I need the HTTP post to send PersonId.
Help!