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. General Programming
  3. C#
  4. CheckBoxCell in DataGridView.

CheckBoxCell in DataGridView.

Scheduled Pinned Locked Moved C#
3 Posts 2 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.
  • S Offline
    S Offline
    Said Ali Jalali
    wrote on last edited by
    #1

    Hi everyOne. I have a DataGridView with a checkBoxCell(Column).I have 30 or...Rows in my dataGridView and i check 20 rows. I want to know how many rows is checked. And how many is Not. Thank u.

    CanI

    H 2 Replies Last reply
    0
    • S Said Ali Jalali

      Hi everyOne. I have a DataGridView with a checkBoxCell(Column).I have 30 or...Rows in my dataGridView and i check 20 rows. I want to know how many rows is checked. And how many is Not. Thank u.

      CanI

      H Offline
      H Offline
      Henry Minute
      wrote on last edited by
      #2

      According to my calculations you have 20 checked, which leaves 10 unchecked. Hope this helps! :)

      Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

      1 Reply Last reply
      0
      • S Said Ali Jalali

        Hi everyOne. I have a DataGridView with a checkBoxCell(Column).I have 30 or...Rows in my dataGridView and i check 20 rows. I want to know how many rows is checked. And how many is Not. Thank u.

        CanI

        H Offline
        H Offline
        Henry Minute
        wrote on last edited by
        #3

        Something like the following should suffice:

        int checkedCount = 0;
        foreach (DataGridRow row in this.myDataGridView)
        {
            if (row.Cells\["nameOfYourColumn"\].Value == true)
            {
                checkedCount++;
            }
        }
        

        Sorry about the previous post, I couldn't resist! :-D

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        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