how to get webgrid column values for each row on controller side in mvc or if want to get particular row and column value.
var exceldata = Db.stus.ToList(); WebGrid grid = new WebGrid(source: exceldata, canPage: false, canSort: false); var gridData = grid.GetHtml( columns: grid.Columns( grid.Column("stu_id", "Id"), grid.Column("Stu_name", "Name"), grid.Column("class", "Class"), grid.Column("roll", "Roll"), grid.Column("email", "Email"), grid.Column("phone", "Phone") )).ToString(); int columns = gridData.Length; foreach(var item in gridData) { int id=???? string class=??? string name=??? string email=??? }
exceldata
foreach (var item in exceldata) { int id = item.Id; ... }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)