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. DataGridView - check a CheckBoxCell

DataGridView - check a CheckBoxCell

Scheduled Pinned Locked Moved C#
questioncsshelp
4 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.
  • C Offline
    C Offline
    C Scharbe
    wrote on last edited by
    #1

    can somebody help me? :confused: how can i check a checkbox in a checkbox cell? my currenty code is like that: colValueCheckBox.TrueValue = "1"; DataGridViewCheckBoxCell cellValue = colValueCheckBox.CellTemplate.Clone() as DataGridViewCheckBoxCell; cellValue.Value = "1"; gridRow.Cells.Add(cellValue); grid.Rows.Add(gridRow); but it doesent check the box in that cell (i need some code to check this box! - can be different to that) THNX

    J C 2 Replies Last reply
    0
    • C C Scharbe

      can somebody help me? :confused: how can i check a checkbox in a checkbox cell? my currenty code is like that: colValueCheckBox.TrueValue = "1"; DataGridViewCheckBoxCell cellValue = colValueCheckBox.CellTemplate.Clone() as DataGridViewCheckBoxCell; cellValue.Value = "1"; gridRow.Cells.Add(cellValue); grid.Rows.Add(gridRow); but it doesent check the box in that cell (i need some code to check this box! - can be different to that) THNX

      J Offline
      J Offline
      Judah Gabriel Himango
      wrote on last edited by
      #2

      I'm not too familiar with the DataGridView, but have you tried doing something like cellValue.Value = true; ?

      Tech, life, family, faith: Give me a visit. I'm currently blogging about: Dumbest. Movie. Title. Evaaar. The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

      C 1 Reply Last reply
      0
      • J Judah Gabriel Himango

        I'm not too familiar with the DataGridView, but have you tried doing something like cellValue.Value = true; ?

        Tech, life, family, faith: Give me a visit. I'm currently blogging about: Dumbest. Movie. Title. Evaaar. The apostle Paul, modernly speaking: Epistles of Paul Judah Himango

        C Offline
        C Offline
        C Scharbe
        wrote on last edited by
        #3

        ok thats what i already tried to check this box, too: cellValue.Value = true; cellValue.Value = colValueCheckBox.TrueValue; i also tried cellValue.Value = true; without setting any TrueValue or FalseValue. i also tried to test it with ThreeState = true;.

        1 Reply Last reply
        0
        • C C Scharbe

          can somebody help me? :confused: how can i check a checkbox in a checkbox cell? my currenty code is like that: colValueCheckBox.TrueValue = "1"; DataGridViewCheckBoxCell cellValue = colValueCheckBox.CellTemplate.Clone() as DataGridViewCheckBoxCell; cellValue.Value = "1"; gridRow.Cells.Add(cellValue); grid.Rows.Add(gridRow); but it doesent check the box in that cell (i need some code to check this box! - can be different to that) THNX

          C Offline
          C Offline
          C Scharbe
          wrote on last edited by
          #4

          Ok, i found the answer, i added the checkboxcell to a invisible column, and i didn't think about that as i add the cell of a row. :~

          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