سؤال

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 ?

هل كانت مفيدة؟

المحلول

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); 
}
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top