When working on asp.net web forms, I encountered an issue where I was unable to display pagination links as buttons with a gray background on the grid view control.
To achieve this, I needed to assign a CSS class to the pager style on the grid view in order to display the links as buttons with a gray background, similar to what is shown in the image below:
<asp:GridView ID="GridViewSearchData" runat="server" AutoGenerateColumns="false" DataKeyNames="ID" AllowPaging="true" OnPageIndexChanging="grdData_PageIndexChanging" PageSize="10" >
<PagerStyle CssClass=""/>
</asp:GridView>
In the CSS class, I needed to assign a class to the pager style that would display the link as a button. If there was an alternative method without using CSS, I was open to suggestions.
<style type="text/css">
// Any guidance on how to achieve this?
</style
Expected result:
https://i.sstatic.net/fnVzT.png
Updated Answer:
I managed to apply a square box around the page number but now I need to increase the height and width of the box surrounding the page numbers (e.g., 1,2,3, etc.). Is it possible to also change the background color of the page numbers to match the image provided?
After making the changes as suggested, I noticed that the buttons were not the same size and did not have the same background. How can I modify the CSS to rectify this issue?