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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Datagrid Row

Datagrid Row

Scheduled Pinned Locked Moved ASP.NET
question
6 Posts 3 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.
  • K Offline
    K Offline
    kirthikirthi
    wrote on last edited by
    #1

    HI How can i calculate datagrid Row I want calculate the total row of a datagrid EX : ------ ---------------------------- ID Name Marks ---------------------------- 1 aaa 200 2 bbb 250 3 ccc 200 ---------------------------- Total 650 THX

    asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf

    _ S 2 Replies Last reply
    0
    • K kirthikirthi

      HI How can i calculate datagrid Row I want calculate the total row of a datagrid EX : ------ ---------------------------- ID Name Marks ---------------------------- 1 aaa 200 2 bbb 250 3 ccc 200 ---------------------------- Total 650 THX

      asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf

      _ Offline
      _ Offline
      _AK_
      wrote on last edited by
      #2

      you can get it with items.count :)

      Best Regards, Apurva Kaushal

      K 1 Reply Last reply
      0
      • _ _AK_

        you can get it with items.count :)

        Best Regards, Apurva Kaushal

        K Offline
        K Offline
        kirthikirthi
        wrote on last edited by
        #3

        HI I want to calculate the ROW items Total in Datagrid Itiems ------- 10 20 30 ------------- Total = 60 ---------------

        asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf

        _ 1 Reply Last reply
        0
        • K kirthikirthi

          HI I want to calculate the ROW items Total in Datagrid Itiems ------- 10 20 30 ------------- Total = 60 ---------------

          asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf

          _ Offline
          _ Offline
          _AK_
          wrote on last edited by
          #4

          Ohh I actually misunderstood your question. For this you can take a label control in the footer of the datagrid to display the total and to calculate the total you can use the Onitemdatabound event there you can take a variable and keep adding all the corresponding values of all the rows.

          Best Regards, Apurva Kaushal

          1 Reply Last reply
          0
          • K kirthikirthi

            HI How can i calculate datagrid Row I want calculate the total row of a datagrid EX : ------ ---------------------------- ID Name Marks ---------------------------- 1 aaa 200 2 bbb 250 3 ccc 200 ---------------------------- Total 650 THX

            asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf

            S Offline
            S Offline
            safat
            wrote on last edited by
            #5

            int j=0; int RowCount=myDataSet.Tables["tablename"].Rows.Count; for(int i=0;i Where the mydataset is the datasource of data grid and "tablename" is the data member of the datagrid. :mad: Sathik

            K 1 Reply Last reply
            0
            • S safat

              int j=0; int RowCount=myDataSet.Tables["tablename"].Rows.Count; for(int i=0;i Where the mydataset is the datasource of data grid and "tablename" is the data member of the datagrid. :mad: Sathik

              K Offline
              K Offline
              kirthikirthi
              wrote on last edited by
              #6

              Hi Thx For reply I am using VB.NET Can U plz CHK Is it right -------------------------- Dim j As Integer = 0 Dim RowCount As Integer = dsCustomers.Tables("Tottime").Rows.Count Dim i As Integer Dim DgDiscovered While i j += Convert.ToInt32(DgDiscovered(i, 1).ToString()) ' End While rc.Text = j.ToString() -----------------------------------------

              asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf

              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