This question is locked. New answers and comments are not allowed.
I am trying to use the MVC panelbar in my code. I am using the dataBindingToController. My controller looks like this
where QryNavigation is my stored procedure. My view looks like
I dragged two tables in my LINQTOSQL one is tblSectionLink and another one is tblsection. I also dragged the stored procedure to the dbml page.
The stroed procedure already establishes the relationship between tblSection and tblsectionLinks. My stored procedure is like this
I am getting an error :
Any help will be greatly appreciated.
public ActionResult DataBindingToModel() { DataContext cr = new DataContext(); return View(cr.QryNavigation(4)); }where QryNavigation is my stored procedure. My view looks like
<%= Html.Telerik().PanelBar() .Name("PanelBar") .HtmlAttributes(new { style = "width: 300px;" }) .BindTo(Model, mappings => { mappings.For<tblSection>(binding => binding .ItemDataBound((item, tblSection) => { item.Text = tblSection.Section; }) .Children(tblSection => tblSection.tblSectionLinks)); mappings.For<tblSectionLink>(binding => binding .ItemDataBound((item, tblSectionLink) => { item.Text = tblSectionLink.Title; })); }) %>I dragged two tables in my LINQTOSQL one is tblSectionLink and another one is tblsection. I also dragged the stored procedure to the dbml page.
The stroed procedure already establishes the relationship between tblSection and tblsectionLinks. My stored procedure is like this
SELECT s.Section, sl.Title, sl.Link FROM dbo.tblSection AS s INNER JOIN dbo.tblSectionLinks AS sl ON s.PKSectionID = sl.FKSectionID WHERE s.AccessLevel <= @AccessI am getting an error :
Cannot use a lambda expression as an argument to a dynamically dispatched operation without first casting it to a delegate or expression tree type Line 10: .Name("PanelBar") Line 11: .HtmlAttributes(new { style = "width: 300px;" }) Line 12: .BindTo(Model, mappings => Line 13: { Line 14: mappings.For<tblSection>(binding => binding Any help will be greatly appreciated.