Hi All,
I have used webgrid in my application in a view.
@model WebGridSample.Models.students
<script src="~/Scripts/jquery-1.7.1.js" type="text/javascript"></script>
@{
var grid = new WebGrid(Model,
canPage: true,
rowsPerPage: 3,
selectionFieldName: "selectedRow",
ajaxUpdateContainerId: "studGrid");
grid.Pager(WebGridPagerModes.NextPrevious);
}
@grid.GetHtml(tableStyle: "studWebGrid",
headerStyle: "header",
alternatingRowStyle: "altRow",
selectedRowStyle: "select",
columns: grid.Columns(
grid.Column("Id", "ID"),
grid.Column("Name", " Name"),
grid.Column("Maths", "Maths"),
grid.Column("Science", "Science"),
grid.Column("Social", "Social")
))
Here i bind only the students model to the grid.
but I want to bind different model dynamically to the grid.
Whether i can do this. if yes then How..?
can anyone please help me on this..
Thanks in Advance,
Abi..