Telerik Forums
UI for ASP.NET MVC Forum
1 answer
223 views

Simple question: what NuGet files and namespaces contain the "ToPagedList" methods?

Detail:

New to Telerik, new to these Forums, but thrilled they are here. I have what SHOULD be a simple question...

Web Application written 4 years ago using Telerik ASP.NET MVC (I think) and Telerik Kendo (I think). The 2017 App is running in production, but I need to make changes in the code (new feature stuff). Meanwhile, the guy who wrote it is no longer here - there is no one left who has touched it. Undocumented, of course. And we have moved from Visual Studio 2017 to Visual Studio 2019.

So I am trying to get the application to build pretty much "as is" so I can tinker with it and see how it works, and figure out exactly where I need to make changes. First build had 274 errors, then 64 errors... now down to 1 error in two places in one class; a reference to "ToPagedList" which is a method apparently used to pluck a specified page or pages from a result set for rendering (in a Grid?). Virtually all of that was uninstalling and reinstalling NuGet files because somehow they lost their initialization in the app files. So, plenty of places I could have gone awry.

"ToPagedList" works on a View derivative class; but apparently I am not including the proper Telerik references and libraries to get these two references to "ToPagedList" to resolve. Probably have some class confusion as well (something referencing Microsoft instead of Telerik). 

The first of the two errors, other is basically identical in the same class:

Severity Code Description Project File Line Suppression State
Error CS1061 'IQueryable<IncidentDetailView>' does not contain a definition for 'ToPagedList' and no accessible extension method 'ToPagedList' accepting a first argument of type 'IQueryable<IncidentDetailView>' could be found (are you missing a using directive or an assembly reference?) QCWeb D:\QCWeb\QCWeb\Controllers\ReportController.cs 248 Active

Line 248 looks like:

return View(tickets.ToPagedList(pageNumber, pageSize));

where tickets is an instantiation of the "IQueryable<IncidentDetailView>",

and IncidentDetailView is partial class that contains the Entity Framework record field definitions for a database pseudo-table (query results).

If I could figure out which Telerik library that this method is defined in, I can probably work back to get other references properly aligned as well (ever the optimist). I am just not having much luck searching the Telerik documentation for class method lists and descriptions, nor am I having much luck playing library roulette. Any ideas?  Thanks!!

Ivan Danchev
Telerik team
 answered on 29 Nov 2021
1 answer
102 views

Hello, 

I try to get dataSource from my MVC project but got syntax error. Could someone tell me what's wrong? Thanks.

Action method on MyController:

        public JsonResult Position_Read()
        {
                var entity = new PositionViewModel
                {
                   POS_ID = "10000",
                   POS_TYPE="INTER",
                   CREATE_DT = DateTime.Now
                };

                return Json(entity);
          }

 

JavaScript in View:

 <script>

        function GetServerSourceData() {
            var ds = new kendo.data.DataSource({
                type: "odata",
                transport: {
                    read: "/MySite/MyController/Position_Read"
                },
                schema: {
                    model: {
                        fields: {
                            POS_ID: { type: "string" }, 
                            POS_TYPE: { type: "string" }
    CREATE_DT: { type: "date" },
                        }
                    }
                }
            });
            return ds;
        } 

 </script>

                         
Anton Mironov
Telerik team
 answered on 10 Aug 2021
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?