pagertemplate

PagerTemplate does not show when GridView is empty in ASP

柔情痞子 提交于 2019-12-11 07:06:15
问题 I am trying to make a small ASP.NET application where I have a GridView with data being accessed from the database. I also have a PagerTemplate that has LinkButtons that allow me to add in a new record to the database. However when the table is empty I am not able to see my Pager controls, but I have no issues if there is a single entry in the table. Is there any way that I can always display the PagerTemplate. Please is a sample of my code. <asp:GridView ID="gvResults" runat="server"

FormView not displaying PagerTemplate when only 1 item in DataSource

瘦欲@ 提交于 2019-12-11 03:13:28
问题 I have a FormView control with a custom PagerTemplate with my own paging LinkButtons. All works great until the dataset that I load only contains one record/item and hides the PagerTemplate completely. I've searched online and found several answers to simply add: protected void fvAppHMDA_PreRender(object sender, EventArgs e) { if (fvAppHMDA.TopPagerRow != null) fvAppHMDA.TopPagerRow.Visible = true; } However, this is not making one bit of difference. It seems that when there is only one