Thanks mike
I also notice that DisplayPageSizeSelector only checks Allow paging.
Suggest adding a condition test for paging like
private bool TestPagingRowRequired()
{
return (this.AllowPaging
&& (this.PagerSettings != null && this.PagerSettings.Visible)
&& this.RecordsCount > this.PageSize
);
}
and calling in
private void DisplayPageSizeSelector(GridViewRow dgItem)
{
if (!TestPagingRowRequired()) return;
...and
protected override void OnPreRender(EventArgs e)
{
base.OnPreRender(e);
if (TestPagingRowRequired())
{
_gridPagerRow.Visible = true;
}
}I also noticed that when the pager row is displayed that OnRowCreated gets called twice for the pager row.