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 8833047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:41:04+00:00 2026-06-14T08:41:04+00:00

I am trying to implement paging toolbar on extjs grid pangel using c# backend…

  • 0

I am trying to implement paging toolbar on extjs grid pangel using c# backend… How do I start doing about that… I have tried using start and limit but I am not sure how it works. could someone please help me on how I can just send about 20 records per page in the grid, because my grid is getting all 500 datas, which is slowing my application as well
below is my controller that sends json to my store.. Please help

 public JsonResult getData(int start, int limit)
 {
   List<MyItem> items = new List<MyItem>();
   using (SqlConnection con = new SqlConnection(ConfigurationManager.ConnectionStrings["ApplicationServices1"].ConnectionString))
   {
     SqlCommand cmd = con.CreateCommand();
     cmd.CommandText = "SELECT State, Capital FROM MYDBTABLE";
     con.Open();
     SqlDataReader reader = cmd.ExecuteReader();
     while (reader.Read())
     {
       MyItem item = new MyItem();
       item.State = reader[0].ToString(); 
       item.Capital = reader[1].ToString(); 
       items.Add(item);
     }
     con.Close();

     return Json(new {  myTable = items }, JsonRequestBehavior.AllowGet);
   }
}

and this is my store

this.store = Ext.create('Ext.data.JsonStore', {
        autoLoad: true,
        storeId: 'mystore1',
        pageSize: 20,
        fields: [
    { name: 'State' },
    { name: 'Capital' } 
    ],
        sorters: [
            {
                property: 'State',
                direct: 'ASC'
            }],
        scope: this,
        proxy: {
            type: 'ajax',
            scope: this,
            url: 'StateC/getData',
            autoLoad: { params: {
                start: 0,
                limit: 20
            }
            },
            reader: {
                type: 'json',
                root: 'myTable'
            }
        }
    });
  • 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-06-14T08:41:06+00:00Added an answer on June 14, 2026 at 8:41 am

    I’m currently using MySQL & PHP so definitely error check my syntax on this, but the general logic is similar, however the syntax is a little more vague in MsSQL for the query. I would suggest this link for the a primer on the MsSQL recomended syntax:

    http://www.codeguru.com/csharp/.net/net_data/article.php/c19611/Paging-in-SQL-Server-2005.htm

    First you need to get the parameters that are passed by extjs on the ajax calls:

    int limit = Request.QueryString["limit"];
    int page= Request.QueryString["page"];
    int upperBound = limit * page;
    int lowerBound = limit * (page - 1) + 1;
    

    I think that should work out to something like this for your query as well:

    SELECT * FROM (
            SELECT 
                ROW_NUMBER() OVER(ORDER BY person) AS rownum, 
                MYDBTABLE.State, 
                MYDBTABLE.Capital 
            FROM MYDBTABLE
        ) AS States
    WHERE  States.rownum >= {lowerBound} AND States.rownum <= {upperBound}
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to implement paging in xml using this code and got around to
I'm trying to implement a paging and sorting list in ASP.NET MVC without using
I am trying to implement paging in PHP, using Json. I need the data
I am trying to implement a paging feature using PDO's ability to create cursors.
I have following sample application, where i am trying to implement paging functionality for
I am trying to implement simple paging on my sharepoint webpart. I have a
I am trying to implement paging and i done that. The problem is when
I have been trying to understand a little bit about how to implement custom
I'm trying to implement paging in a custom ListAdapter. Right now I'm just making
I'm trying to implement a custom tab bar which is scrollable and has paging

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.