lorena Posted February 14, 2006 Posted February 14, 2006 I have a series of pages that display closed files in different folders. Some of the folders have many files and some have few. Is it possible to create an event that displays or hides the Pager based on the file count? Thanks in advance Quote
cyclonebri Posted February 15, 2006 Posted February 15, 2006 Sure, all you need to do is add this function, and call it as you will: Private Sub GridPagerVisibility(ByVal ShowHide As Boolean) Me.DataGrid1.PagerStyle.Visible = ShowHide End Sub so you would say something like this on postback: if myFileCount < 100 Then GridPagerVisibility(False) else GridPagerVisibility(True) end if Good Luck! Quote
lorena Posted February 19, 2006 Author Posted February 19, 2006 I just wanted to follow up. I put this in my code and it worked perfectly. Thanks so much! Quote
cyclonebri Posted February 19, 2006 Posted February 19, 2006 Glad it worked and that I could help out! I was also thinking, if you wanted to get crazy you could have the datagrid be passed into the function as well: Private Sub GridPagerVisibility(ByVal ShowHide As Boolean, byref dg1 as System.Web.UI.WebControls.DataGrid) dg1.PagerStyle.Visible = ShowHide End Sub Take Care! Brian Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.