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 :
By using the above my problem will get solved but this is giving me an error as :
"cannot convert from lambda expression to system.func<dynamic,object>"
as inside the grid LINQ or LAMBDA is not permitted.
WHAT should i do to show the selected item in drop down against particular records in web grid ???
Any help will be of great deal....
Thanks in Advance....
Microsoft réalise une enquête en ligne pour comprendre votre opinion sur le site Web de Msdn. Si vous choisissez de participer, l’enquête en ligne vous sera présentée lorsque vous quitterez le site Web de Msdn.