Answer the question
In order to leave comments, you need to log in
How to change the number of displayed pages in WebGrid asp.net mvc?
By default, the GridView displays posts with links to 5 pages. How to make links to pages more than 5?
Answer the question
In order to leave comments, you need to log in
@{
var grid = new WebGrid(/*...*/);
}
@grid.GetHtml(mode: WebGridPagerModes.Numeric, numericLinksCount: 10)
или отдельно список страниц:
@grid.Pager(numericLinksCount: 10)
public IHtmlString GetHtml( string tableStyle, string headerStyle, string footerStyle, string rowStyle, string alternatingRowStyle, string selectedRowStyle, string caption, bool displayHeader, bool fillEmptyRows, string emptyRowCellValue, IEnumerable<WebGridColumn> columns, IEnumerable<string> exclusions, WebGridPagerModes mode, string firstText, string previousText, string nextText, string lastText, int numericLinksCount, Object htmlAttributes )
Type: System.Int32
The number of numeric links to the next WebGrid pages . The text of each digital page link contains the page number. Set the mode parameter 's Numeric flagto display these controls on the page.
public HelperResult Pager( WebGridPagerModes mode, string firstText, string previousText, string nextText, string lastText, int numericLinksCount )
Type: System.Int32
The number of numeric page links to display. The default value is 5 .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question