Question

I'm using gridview , and a datapager in it , I couldn't find a way to hide the pager. I tried this code :

pager.Visible = (pager.PageSize < pager.TotalRowCount); 

Is there any other way to achieve it ?

Était-ce utile?

La solution

You can use this code if you add it in the OnDataBound event

protected void GridView1_DataBound(object sender, EventArgs e)
{
     pager.Visible = (pager.PageSize < pager.TotalRowCount); 
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top