Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1063175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:44:41+00:00 2026-05-16T18:44:41+00:00

how do i make my grdivew page more dynamic than hardcoded upto 5 pages?,

  • 0

how do i make my grdivew page more dynamic than hardcoded upto 5 pages?,
below code works fine but the limitation is that i can show upto 5 pages because i have 5 linkbutons. how can i make this code more dynamic page numbers?

<asp:GridView ID="gvTable" runat="server" ShowHeader="true"      
  PageSize="5" AllowPaging="true" AllowSorting="true"      
  DataSourceID="myLinqDataSource" AutoGenerateColumns="false"      
  OnRowDataBound="GridView_DataBound">      
  <Columns>      
    <asp:BoundField DataField="Edited" HeaderText="Date" DataFormatString="{0:d}" />      
    <asp:BoundField DataField="Activity" HeaderText="Notes" />      
  </Columns>      
  <PagerTemplate>
                        <div style="float: left; margin-left: 7px; line-height: 22px;">
                            <div style="float: left;">
                                <asp:ImageButton CommandName="Page" CommandArgument="First" ToolTip="First Page"
                                    runat="server" ID="PagerFirstButton"   />
                                <asp:ImageButton ID="PagerPrevButton" CommandName="Page" CommandArgument="Prev" ToolTip="Previous Page"
                                    runat="server"  />
                            </div>
                            <div style="float: left;">
                                <div class="pagerNumber">
                                    <asp:LinkButton runat="server" ID="NumericPager1" CommandArgument="1" Text="1" CommandName="Page" />
                                </div>
                                <div class="pagerNumber">
                                    <asp:LinkButton runat="server" ID="NumericPager2" CommandArgument="2" Text="2" CommandName="Page" />
                                </div>
                                <div class="pagerNumber">
                                    <asp:LinkButton runat="server" ID="NumericPager3" CommandArgument="3" Text="3" CommandName="Page" />
                                </div>
                                <div class="pagerNumber">
                                    <asp:LinkButton runat="server" ID="NumericPager4" CommandArgument="4" Text="4" CommandName="Page" />
                                </div>
                                <div class="pagerNumber">
                                    <asp:LinkButton runat="server" ID="NumericPager5" CommandArgument="5" Text="5" CommandName="Page" />
                                </div>
                            </div>
                            <div style="float: left;">
                                <asp:ImageButton ID="PagerNextButton" CommandName="Page" CommandArgument="Next" ToolTip="Next Page"
                                    runat="server" />
                                <asp:ImageButton ID="PagerLastButton" CommandName="Page" CommandArgument="Last" ToolTip="Last Page"
                                    runat="server"  />
                            </div>
                        </div>
                        <div style="float: left; margin-left: 12px;">
                            <div style="float: left; margin: 4px 6px 0px 0px;">
                                Page Size</div>
                                                     </div>
                        <div class="gridCount" runat="server" id="divGridCount">
                            <b>1</b> Items Found &nbsp;</div>
  </PagerTemplate>  

</asp:GridView>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T18:44:42+00:00Added an answer on May 16, 2026 at 6:44 pm

    here is what i able to achive:

      <PagerStyle HorizontalAlign="Left" CssClass='header' BackColor="#E5EAF3" ForeColor="Black" />
    <PagerSettings Mode="NumericFirstLast" />
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

To make matter more specific: How to detect people names (seems like simple case
Make seems to me simply a shell script with slightly easier handling of command
Make something like in html/css
i make a Jquery function that (for the moment) call a function dinamically and
I make some changes in local files, how can I deploy the new version?
I make use of: NetBeans IDE 6.7.1, GlassFish v2.1, Oracle 10g XE, JAVA 6
I make a clj script for running clojure as follows. java -cp $CLOJURE_JAR:$CLASSPATH clojure.main
I make a BroadcastReceiver to receive Phone number of the person who call me
long make_checksum(const char* str) { long chk=0; long rot=0; while(*str) { rot<<=9; rot|=(rot>>23); rot^=*(char*)str++;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.