My question is related to the inclusion of drop-down list in a web grid in MVC 3.0.
My Controller Written data as:
var query = ezee.Select(c => new SelectListItem
{
Value = c.CUSTOMLISTId.ToString(),
Text = c.CUSTOMLISTName.ToString(),
Selected = c.CUSTOMLISTId.Equals(itemlist.Select(i=>i.RESOURCETYPEID))
});
ViewBag.CUSTOMLIST= query.AsEnumerable();
i have added a drop down control to my webgrid like that :
The above works fine as "viewbag.CUSTOMLIST" brings me all the data from controller which i want to display, now my problem is how i can show the "selected" item in the drop down in web grid's row. I am trying to do this :