public ActionResult PatientEnquiries()
{
var k = from p in db.MPatientRegistrations
join p1 in db.PatientComplaints on p.PatientId equals p1.PatientId
join p2 in db.PDoctorSelections on p.PatientId equals p2.PatientId
select new
{
name = p.Name,
Age = p.Age,
MobileNo=p.MobileNo,
complaint=p1.Complaint,
Request=p1.Request,
Id=p2.DoctorId
};
return View(k.ToList());
}
This is my view
I got the answer by using above code
This is my view
@{
Layout = "../Shared/_DoctorRegistration.cshtml";
}
@{
var grid = new WebGrid(Model, canPage: true, rowsPerPage:3,
selectionFieldName: "selectedRow",ajaxUpdateContainerId: "gridContent");
grid.Pager(WebGridPagerModes.NextPrevious);}
@grid.GetHtml(tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
selectedRowStyle: "selectedrow",
columns: grid.Columns(
grid.Column("Name","Name"),
grid.Column("Age","Age"),
grid.Column("MobileNo","MobileNo"),
grid.Column("complaint","complaint"),
grid.Column("Request","Request"),
grid.Column("Id","Id")
))
Replies
Know the answer? Post it — somebody with the same question will find it here.