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

[Solved] No generic method 'OrderBy' on type 'System.Linq.Queryable'

0 Answers 271 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.
quentinjs
Top achievements
Rank 1
quentinjs asked on 22 Sep 2010, 05:03 AM

Any idea why I am getting this error message when I Sort or do a GroupBy ?
No generic method 'OrderBy' on type 'System.Linq.Queryable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.

<%@ Page Title="" Language="C#" 
    MasterPageFile="~/Views/Shared/Site.Master" 
    Inherits="System.Web.Mvc.ViewPage<IEnumerable<glossaryDB.TypedListClasses.ProjectListRow>>"
%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Project: List
</asp:Content>

<asp:Content ID="Masthead" ContentPlaceHolderID="MastheadContent" runat="server">
    <%  Html.RenderPartial("Searchhead"true);%>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Project: List</h2>

    <%
        ViewData["Search"] = "test";
        ViewData["showInActive"] = false;
        
        Html.Telerik().Grid(Model)
            .Name("Project")
            .PrefixUrlParameters(false)            
            .ToolBar(commands => commands.Insert())
            .DataKeys(dataKeys => dataKeys.Add(c => c.ProjectId))
            .DataBinding(dataBinding => dataBinding
           
                                            //Action method
                                            .Server()
                                            .Select("Index""Project",
                                                    new
                                                        {
                                                            Search = (string) ViewData["Search"],
                                                            showInActive = (Boolean)ViewData["showInActive"]
                                                        })

    //(string)ViewData["id"]}) )  // ,"ColumnSettings", "Grid")
                  .Update("Update""Project")
                  .Insert("Edit""Project")
                  .Delete("Delete""Project")
            )
           //Template column which shows an action link
        .Columns(columns =>
        {
            columns.Command(commands => commands.Select()).Title("Select");
            // columns.Command(commands => commands.Select()).Title("Select").;
            columns.Template(o => 
            {
              %>
                  <%= Html.ActionLink("Edit""Edit"new { id = o.ProjectId })
                      %>
              <%
            }).Title("Edit")
                .HtmlAttributes(new { @class = "product-edit-cell" })
                .HeaderHtmlAttributes(new { @class = "product-edit-column" });
         
            columns.Template(o => 
                  {
                     %>
                    <%= Html.ActionLink("View""Details"new { id = o.ProjectId })%>
                    <%
            }).Title("Detail");
            columns.Command(commands =>
            {
                commands.Edit();
                commands.Delete();
            }).Width(180).Title("Commands");
            
            columns.Bound(c => c.ProjectId)
                .HtmlAttributes(new { @class = "product-ProductId-cell" })
                .HeaderHtmlAttributes(new { @class = "product-productId-column" });
                
            columns.Bound(c => c.Name)
                .HtmlAttributes(new { @class = "product-Name-cell" })
                .HeaderHtmlAttributes(new { @class = "product-Name-column" });
            columns.Bound(c => c.Description)
                .HtmlAttributes(new { @class = "product-Description-cell" })
                .HeaderHtmlAttributes(new { @class = "product-Description-column" });
            
            columns.Template(o => 
            {
              %>
                  <%= Html.ActionLink("Delete""Delete"new { id = o.ProjectId })%>
              <%
            }).Title("Delete");             
          })
//        .DataBinding(dataBinding => dataBinding
//                   //The action method which will return JSON
//              .Ajax().Select("_AjaxBindingTL", "Home")
//        )
        .Sortable()
        .Pageable()
//        .Filterable()
        .Groupable()
        .Footer(true)
        .RowAction(row => row.Selected = row.DataItem.ProjectId.Equals(ViewData["id"]))
        .Render();
%>

    <p>
        <%= Html.ActionLink("Create New""Create"%>
    </p>

</asp:Content>

Tags
Grid
Asked by
quentinjs
Top achievements
Rank 1
Share this question
or