I am trying to display a grid on my view in MVC.
I have populated a WebGrid but i cant get it to display?
Could some one please show me how to display a webGrid?
My View’s code is below:
@model MvcResComm.Models.ReturnProperties
@{
ViewBag.Title = "ShowProperties";
}
<h2>Select Property</h2>
@using System.Dynamic
@{
var result = new List<dynamic>();
foreach (var emprow in Model.DDS)
{
var row = (IDictionary<string, object>)new ExpandoObject();
Dictionary<string, object> eachEmpRow = (Dictionary<string, object>)emprow;
foreach (KeyValuePair<string, object> keyValuePair in eachEmpRow)
{
row.Add(keyValuePair);
}
result.Add(row);
}
var grid = new WebGrid(result);
}
this line is needed