Monday, April 2, 2012

Page Index Changing In Gridview


.aspx

    <asp:GridView ID="gvcardetails" AutoGenerateColumns="false" PageSize="20" OnPageIndexChanging="gvcardetails_PageIndexChanging" AllowPaging="True" runat="server" Width="100%" cellpadding="5" cellspacing="1" gridlines="none" bgcolor="#ffffff">
           <Columns>
           <asp:BoundField HeaderText="Id" DataField="iCarPoolOwnerId" Visible="false" ReadOnly="true" />
                        <asp:BoundField HeaderText="CarNo" DataField="CarNo" /> 
                        <asp:BoundField HeaderText="Start Point" DataField="vStartPoint" /> 
                  </Columns>
</asp:GridView>

.aspx.cs
protected void gvcardetails_PageIndexChanging(object sender, GridViewPageEventArgs e)
    {
       gvcardetails.PageIndex = e.NewPageIndex;
       bindgrid();  //method for binding Grid
    }

No comments:

Post a Comment

Comments

Search

Custom Search
Protected by Copyscape Plagiarism Software