locked
Not able to set PageIndex of Webgrid in MVC RRS feed

  • Question

  • WebGrid grid = new WebGrid(rowsPerPage: Convert.ToInt32(Model.Filters.PageSize), canSort: true, canPage: true, ajaxUpdateContainerId: "AHGrid");
        grid.Bind(Model.lstAH, autoSortAndPage: true, rowCount: Model.TotalRows);

        grid.PageIndex   = Model.Filters.PageIndex; 

    IN MVC 4 We have used Webgrid  functinality.

    When i am trying to set pageindex manually by code. it shows exception at run time.

    Please look at above code snippets and help me out.

        
    • Moved by Mike Danes Thursday, May 29, 2014 11:11 AM asp.net related
    Thursday, May 29, 2014 10:00 AM

Answers

All replies

  • Please use the ASP.NET forums for MVC specific questions: http://forums.asp.net/1146.aspx/1?MVC
    • Proposed as answer by Just Karl Wednesday, June 4, 2014 2:03 PM
    • Marked as answer by Just Karl Wednesday, June 18, 2014 3:29 PM
    Thursday, May 29, 2014 10:42 AM
  • Mike Can you give example how to set pageindex for webgrid in CSHTML page for MVC.

    Wednesday, June 4, 2014 5:32 AM
  • "Can you give example how to set pageindex for webgrid in CSHTML page for MVC."

    Nope. I told you clearly where to ask MVC related questions.

    Wednesday, June 4, 2014 9:21 AM