Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Datagrid item count while paging........

Datagrid item count while paging........

Scheduled Pinned Locked Moved ASP.NET
csshelp
6 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nagraj Naik
    wrote on last edited by
    #1

    Hi All, I am having problem regarding paging in datagrid. datagrid1.items.count will give me total number of items in grid. But if I am using Paging in grid and I want count total number of items in grid how I can do that. datagrid1.items.count will provide count for current page only and not for total items in all pages in datagrid. I hope you will suggest some solution. Regards, Nagraj -- modified at 6:51 Friday 30th June, 2006

    A T D N 4 Replies Last reply
    0
    • N Nagraj Naik

      Hi All, I am having problem regarding paging in datagrid. datagrid1.items.count will give me total number of items in grid. But if I am using Paging in grid and I want count total number of items in grid how I can do that. datagrid1.items.count will provide count for current page only and not for total items in all pages in datagrid. I hope you will suggest some solution. Regards, Nagraj -- modified at 6:51 Friday 30th June, 2006

      A Offline
      A Offline
      Amit Agarrwal
      wrote on last edited by
      #2

      hi i think u were binding ur Datagrid usng datatable then u can count the number rows in datatable. like let say dim dt as datatable dt.rows.count will give u the number of rows that will show in datagrid. i think it will help full for u or u r using some thing else to bind the grid. thanks aavesh

      1 Reply Last reply
      0
      • N Nagraj Naik

        Hi All, I am having problem regarding paging in datagrid. datagrid1.items.count will give me total number of items in grid. But if I am using Paging in grid and I want count total number of items in grid how I can do that. datagrid1.items.count will provide count for current page only and not for total items in all pages in datagrid. I hope you will suggest some solution. Regards, Nagraj -- modified at 6:51 Friday 30th June, 2006

        T Offline
        T Offline
        Tirthadip
        wrote on last edited by
        #3

        Hi , I cant actually understand your problem. You are binding your grid with some table data through dataset.Then you can easily count your total no. of records by a single query or one line of code. if you are using dataset then put---- DataTable dt=(DataTable) ds.Table[0];// ds is the DataSet name int count; count=dt.Rows.Count(); Alternatively you can use SQL query or stored procedure for counting total records. Even if you add or delete records from datagrid then update the dataset. Why are you using datagrid1.items.count ? May be I cant understand your problem. If I am wrong then write without hesitation. Tirthadip Live life to the fullest

        N 1 Reply Last reply
        0
        • T Tirthadip

          Hi , I cant actually understand your problem. You are binding your grid with some table data through dataset.Then you can easily count your total no. of records by a single query or one line of code. if you are using dataset then put---- DataTable dt=(DataTable) ds.Table[0];// ds is the DataSet name int count; count=dt.Rows.Count(); Alternatively you can use SQL query or stored procedure for counting total records. Even if you add or delete records from datagrid then update the dataset. Why are you using datagrid1.items.count ? May be I cant understand your problem. If I am wrong then write without hesitation. Tirthadip Live life to the fullest

          N Offline
          N Offline
          Nagraj Naik
          wrote on last edited by
          #4

          Hi, Basically I am using 3 tier arch. In which we are calling function which is in 2 layer.this function returns dataset which is then assigned to datagrid in 1 layer.So I can only return dataset from function and not table item count. So my question is how I can get no of items from this returned dataset I hope now I am clear from myside. Thanks,

          1 Reply Last reply
          0
          • N Nagraj Naik

            Hi All, I am having problem regarding paging in datagrid. datagrid1.items.count will give me total number of items in grid. But if I am using Paging in grid and I want count total number of items in grid how I can do that. datagrid1.items.count will provide count for current page only and not for total items in all pages in datagrid. I hope you will suggest some solution. Regards, Nagraj -- modified at 6:51 Friday 30th June, 2006

            D Offline
            D Offline
            DIMPLE_R
            wrote on last edited by
            #5

            Why can't you just derive the number of rows from the returned dataset? something like: ds.Tables(0).Rows.Count

            1 Reply Last reply
            0
            • N Nagraj Naik

              Hi All, I am having problem regarding paging in datagrid. datagrid1.items.count will give me total number of items in grid. But if I am using Paging in grid and I want count total number of items in grid how I can do that. datagrid1.items.count will provide count for current page only and not for total items in all pages in datagrid. I hope you will suggest some solution. Regards, Nagraj -- modified at 6:51 Friday 30th June, 2006

              N Offline
              N Offline
              Nagraj Naik
              wrote on last edited by
              #6

              Hi, Thanks for your time,Your solution works. But I find out some another solution. Hope to meet soon............ Regards, Nagraj.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups