How to pass Viewdata to View Grid
LINQContext obj = new LINQContext();public void Dataresults()
{
var result = from r in obj.tablename select r;
ViewData["rslt']= result;
}
How to pass this ViewData in MVC grid
<table>
@if(ViewData["rslt"] != null)
{
foreach (System.Data.DataRow dr in (ViewData["rslt"] as System.Data.DataTable).Rows)
{
// Condition as per your requirement
}
}
</table>