Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Server-side Paging,Filtering & Sorting using MVC6 grid inside my asp.net mvc core

$
0
0

Inside my Asp.net Core MVC i added the MVC6 grid from this url @ https://mvc6-grid.azurewebsites.net/. but i have noted that the paging and filtering will be done on the client side, so each time we filter,sort or paging the whole records will be retrived. so can i force the MVC6 Grid to do the filter,sort and paging on the server-side instead?

Here is my Action Method:-

public async Task<IActionResult> Index()
        {

            var results = await _context.Doctor.ToListAsync();
            return View(results);

        }

and here is the view:-

@model IEnumerable<LandingPageFinal3.Models.Doctor>

@(Html
    .Grid(Model)
    .Build(columns =>
    {
        columns.Add(model => model.PhysicianFirstName).Titled("Name");
        columns.Add(model => model.PhysicianLastName).Titled("Surname");
        columns.Add(model => model.Phone).Titled("Phone");
    })
    .Using(GridFilterMode.Header)
    .Empty("No data found")
    .Filterable()
    .Sortable()
    .Pageable()
)

any advice on this please?

Thanks


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>