Hello everyone m facing difficulty in binding my we grid in view to datasource through my controller action here is my code :
Model:
public DataContext()
: base("conn")
{
}
public DbSet<GeshaftPartner> geschaftPartner { get; set;}
@{
var grid = new WebGrid(Model);
grid.GetHtml(columns:grid.Columns(grid.Column("PartnerName1","Name",canSort :true),
grid.Column("AnSchriftOrt","Ort")));
public ActionResult ShowSelectedPartnerGrid_EF(string partnerID)
DataContext db = new DataContext();
var strQuery = "select PartnerName1,AnSchriftOrt from db.geschaftPartner =" + partnerID;
return View(strQuery.AsEnumerable());