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. CheckBox selection in DataGridView..

CheckBox selection in DataGridView..

Scheduled Pinned Locked Moved C#
question
2 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
    sribachana
    wrote on last edited by
    #1

    Hi, i have added one checkbox to my datagridview.. i want to select the checkbox.... after selecting the check box i need to get the whole row details of that perticular checked row.. DataGridViewCheckBoxColumn ckb = new DataGridViewCheckBoxColumn(); ckb.Name = "Checkbox"; ckb.HeaderText = "Select"; dataGridView1.Columns.Insert(0, ckb); how do i select and deselect the checkbox check options... please reply me ASAP

    P 1 Reply Last reply
    0
    • S sribachana

      Hi, i have added one checkbox to my datagridview.. i want to select the checkbox.... after selecting the check box i need to get the whole row details of that perticular checked row.. DataGridViewCheckBoxColumn ckb = new DataGridViewCheckBoxColumn(); ckb.Name = "Checkbox"; ckb.HeaderText = "Select"; dataGridView1.Columns.Insert(0, ckb); how do i select and deselect the checkbox check options... please reply me ASAP

      P Offline
      P Offline
      Pankaj Joshi
      wrote on last edited by
      #2

      for (int cnt = 0; cnt <= DataGridView1.Rows.Count - 1; cnt++) { DataGridView.Rows[cnt].Cells["ColSelect"].Value = true; } 1. Where ColSelect is your column name. 2. If you want to de-select just write false instead of true. 3. And if you want to know which row is checked and which is not then for (int index = DataGridView1.Rows.Count - 1; index >= 0; index--) { if (Convert.ToBoolean(DataGridView1.Rows[index].Cells[0].Value)) { "Selected" } else { "Not Selected" } } //End of the for :-D

      Regards Pankaj Joshi If you want to shape your dreams into reality, please wake-up...

      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