This is a migrated thread and some comments may be shown as answers.

[Solved] binding my gridview with stored proc

0 Answers 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Anjali
Top achievements
Rank 1
Anjali asked on 28 Jan 2011, 11:54 PM
Hi All,

 I am calling a stored proc in LINQ in my model

public IQueryable getRep(string ea, int days)
    {
        var Data = cr.Getreps(ea, days);
            return Data.AsQueryable();
    }

In the above code GetReps is my stored proc name and it is using the table customers and orders.I don't want to write LINQ because I am trying toc onvert my legacy code to MVC.
In my controller, I have the code below

[AcceptVerbs(HttpVerbs.Post)]
       public ActionResult LoadRep(string ea, int days)
       {
           return View(RepData.getRep(ea, days));
       }

In my view, I have the code
     <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
  
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    GetEA
</asp:Content>
  
 <% Html.Telerik().Grid(Model)
                 .Name("Grid")
                 .Columns(columns =>
                     {
                         columns.Bound(c => c.no);
                                                   
                     })
                     
                    .Sortable()
                    .Scrollable(scrolling => scrolling.Height(250))
                    .Pageable()
                    .Render();
              %>

In my View, I am getting and error for this   .Columns(columns =>   and

(scrolling => scrolling.Height(250))

The error is
cannot use lambda expression as an argument to dynamically dispached operation.without first casting it to delegate.

is it becasue I am using a stord proc in my code.

Any help will be appreciated.
Tags
Grid
Asked by
Anjali
Top achievements
Rank 1
Share this question
or