python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 7, Interview Questions Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
Paging in GridView using c# .net

Paging in GridView using c# .net

In this post, i'm going to share to code snippet for gridview paging using with c#
This example is simple and understandable code using with c#

In the 1st step, code sample for business logic code in page i.e. .aspx.cs as given below.

 protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
                GridView1.PageIndex = e.NewPageIndex;
            catch (Exception ex)
                throw ex;

  /// <returns>DataSet</returns>
  public DataSet GetgroupsList()
            DataSet dsGroupsList = null;
            string spName = "sp_GetAllGroups";
            Hashtable paramTable = new Hashtable();
            dsGroupsList = DataAccess.ExecuteSP(spName, paramTable);
            return dsGroupsList;
In the 2nd step, code sample for UX view in page i.e. .aspx as given below.

<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" pagesize="8"
    width="100%" allowpaging="true" backcolor="White" bordercolor="#CCCCCC"
    borderstyle="None" onpageindexchanging="GridView1_PageIndexChanging"
    borderwidth="1px" cellpadding="4" forecolor="Black" gridlines="Horizontal">
        <asp:BoundField DataField="dateTime" HeaderText="Uploaded Date">                 
        <asp:BoundField DataField="filename" HeaderText="Videos Name">
        <asp:BoundField DataField="filePath" HeaderText="Videos path" InsertVisible="false">                 
                <asp:LinkButton ID="lkbVideo" runat="server" Font-Bold="True" OnClick="lkbVideo_Click">Play</asp:LinkButton>



Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions