views:

175

answers:

2

below code works fine if i remove the PagerSetting or remove PagerTemplate so if i have both (PagerSetting & PagerTemplate) then my page number is not display.

my qeustion is: how can i display both (PagerTemplate and PagerSetting) togather at the bottom of the Gridview ? plese see the below source code.

<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>     
<PagerStyle CssClass="pager-row" />    
                    <RowStyle CssClass="row" />    
                    <PagerSettings Mode="NumericFirstLast" PageButtonCount="7" FirstPageText="«" LastPageText="»" />    
                   **<PagerTemplate>**     
                        <div style="float: left; margin-left: 12px;">    
                            <div style="float: left; margin: 4px 6px 0px 0px;">Page Size</div>    
                            <asp:DropDownList ID="ddlPageSizeChange" runat="server" AutoPostBack="true" OnSelectedIndexChanged="PageSizeChange">    
                                <asp:ListItem>15</asp:ListItem>    
                                <asp:ListItem>25</asp:ListItem>    
                                <asp:ListItem>50</asp:ListItem>    
                                <asp:ListItem>100</asp:ListItem>    
                            </asp:DropDownList>    
                        </div>    
                        <div class="gridCount" runat="server" id="divGridCount"><b>1</b> Items Found  </div>    
                    </PagerTemplate>      
</asp:GridView>  

UPDATE 1:

I able to display paging 1 2 3 4 5... but the problem is: i can not have both PagerSetting & PagerTemplate and if i have both(PagerSetting & PagerTemplate) in my gridview my paging (1 2 3 4 5) is not displaying and if i remove PagerTemplate than my paging is displaying (1 2 3 4 5...) make sense?

UPDATE:

Here is what i am trying to get:

<< < 1 2 3 4 5 ..... > >> Total Pages Found 80 - Page 1/80 - PageSize {15,25,50,10} (this will be a dropdownlist)

A: 

Have a look at this

http://www.codeproject.com/KB/webforms/GridViewCustomPaging.aspx

Try also this

http://www.codeproject.com/KB/grid/ExtendingGridViewControl.aspx

Dorababu
i have update my question please see, the link you provided is not what i am looking for.
Abu Hamzah
I too made a correction check out and mark as answer if helpful
Dorababu
A: 

Try this one too

http://weblogs.asp.net/rajbk/archive/2006/08/14/GridView-DropDownList-Pager.aspx

Dorababu
thanks for the link but what i am looking is paging {1 2 3 4 5}.... and i have already googled before i post my question here. see my updated question and desired result i am looking for.
Abu Hamzah
Hey for the same instead of buttons keep Link buttons and name it like 1,2,34,5 and so on and write the desired code for that as he given by modifying it
Dorababu
Abu Hamzah
Can you please post an image such that we can clearly understand
Dorababu
i dont find an image but i update my question in it i have describe, please have a look at it.
Abu Hamzah