If you open the ~ / DynamicData / Content folder, you will find the pager in GridViewPager.ascx.
You can edit this, since this is the pager used for all gridviews, in the code you will see this field at the top
You can change the number of lines per page per page, or you can set a default value in the code.
protected void Page_Load(object sender, EventArgs e)
{
Control c = Parent;
while (c != null)
{
if (c is GridView)
{
_gridView = (GridView)c;
break;
}
c = c.Parent;
}
***_gridView.PageSize = 20;***
}
Add a line to BOLD ITALIC to set the initial page size and change the value of the page size that it will list, edit the page yourself:
<asp:DropDownList ID="DropDownListPageSize" runat="server"
AutoPostBack="true"
CssClass="droplist"
onselectedindexchanged="DropDownListPageSize_SelectedIndexChanged">
<asp:ListItem Value="5" />
<asp:ListItem Value="10" />
<asp:ListItem Value="15" />
<asp:ListItem Value="20" />
</asp:DropDownList>
source
share