We help IT Professionals succeed at work.

DataPager - hide previous button (image type) when needed

centdevs
centdevs asked
on
Medium Priority
1,265 Views
Last Modified: 2012-05-06
I am using a data pager with next previous pager fields (as images).  When the previous button is not a valid option, I would like it to be more visibly apparent.  For example, swapping out the image for a "grayed out" version, or simply just hiding the previous button.  How can I accomplish this?
<asp:DataPager ID="pgProducts" runat="server" PagedControlID="lvProducts" PageSize="3">
                        <Fields>
                            <asp:NextPreviousPagerField ButtonType="Image"  
                                NextPageImageUrl="/images/more.gif" 
                                PreviousPageImageUrl="/images/back.gif" />
                        </Fields>
                    </asp:DataPager>

Open in new window

Comment
Watch Question

There is a property on the NextPreviousPagerField called RenderDisabledButtonsAsLabels, you can set that to true.  You could then use CSS to modify the label as necessary.

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Wonderful that worked, thank you!!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.