create grid view with devexpress asp.net mvc 5

2.5k Views Asked by At

I want to create a DevExpress grid view in an asp.net mvc 5 .But it did not display pagination, it had just the contents of the grid .How can i add the pagination to the grid?

Controller :

public ActionResult Index()
{
    ViewBag.Message = "Welcome to DevExpress Extensions for ASP.NET MVC!";
    ViewData["Report"] = new Training.UI.Web.Reporting.XtraReport1();
    return View();
}

View :

@Html.DevExpress().GridView(
    settings =>
    {
        settings.Name = "myGridView";
        settings.CallbackRouteValues = new { Controller = "EtatCNFCPP", Action = "GridViewPart" };

        settings.Columns.Add("EntMatriculeFiscal");
        settings.Columns.Add("EntCodeCNSSCnrps");
        settings.Columns.Add("EntNom").SortOrder = DevExpress.Data.ColumnSortOrder.Ascending;

    }).Bind(Model).GetHtml()
2

There are 2 best solutions below

0
On BEST ANSWER

On your grid view setting you can add this line to show the grid pagination.

settings.SettingsPager.PageSizeItemSettings.Visible = true;

You can refer on this link DevExpress MVC Grid View - Data Paging and Scrolling

0
On

In javascript Use the porperty pagingEnabled: false