Hi,
I need to bind editable web grid using data table in mvc razor view engine.i attached my code for reference, Please advise me how to modify the code.
View:
@model System.Data.DataTable
@using System.Data;
@{
List obj1 = new List();
obj1= ViewBag.Total;
var grid = new WebGrid(obj1);
}
@grid.GetHtml(tableStyle: "table", footerStyle: "foot")
Controller:
var ListData = (DataTable)Session["dtResult"]; //data table from session
dns = ConvertDtToList(ListData); //Converted into list
ViewBag.Total = dns; //pass data table to view
2 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.

Balaji PalaniPosted May 25, 2016, 11:45 PM
Vincent Maverick DuranoPosted May 25, 2016, 10:32 AM