Forcing ASP.NET GridView's pager to show Forcing ASP.NET GridView's pager to show asp.net asp.net

Forcing ASP.NET GridView's pager to show


Ok, that wasn't too hard :-)

Based on my initial testing the following did the trick:

GridViewRow pagerRow = (GridViewRow) this.BottomPagerRow;if(pagerRow != null && pagerRow.Visible == false)pagerRow.Visible = true;

I just added that to overridden OnPreRender, and lo, pager is visible, even when there is just one page page of data shown. Got to do some additional testing before I can be sure, though. Seems to simple to me.


The above will workBut this might be helpful also

GridView.BottomPagerRow.Visible=true


   protected void GridView_PreRender(object sender, EventArgs e)    {        GridView gv = (GridView)sender;        GridViewRow pagerRow = (GridViewRow)gv.BottomPagerRow;        if (pagerRow != null && pagerRow.Visible == false)            pagerRow.Visible = true;    }