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 in Datagrid

Checkbox in Datagrid

Scheduled Pinned Locked Moved C#
tutorialcsharpcomhelpquestion
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.
  • A Offline
    A Offline
    Anderson F
    wrote on last edited by
    #1

    :confused: Hi all, I've been trying to have a simple checkbox in my datagrid using C# and it's being a pain to get it to work. Here is the cenario. I have a DataSet populated with a table "Employees" let's say. This table has fields such id, name, email. All I want to do is to display an extra column in my datagrid that will display a checkbox for each row. Note, there is no data associated with this checkbox. I just wanted the user to select some of the Employees from the datagrid by checking the checkbox. Then, when they click the button "Print", I will loop through the datagrid, get the selected ones and print. Anyone can give me some instructions or example of how to do that? I've been looking some people examples that do something similar. But they don't really show how to add an extra column to the datagrid with a checkbox for each record of your already populated dataset. Please, any help will be appreciated. Thanks to all. Anderson Anderson F. afraga22@hotmail.com

    C 1 Reply Last reply
    0
    • A Anderson F

      :confused: Hi all, I've been trying to have a simple checkbox in my datagrid using C# and it's being a pain to get it to work. Here is the cenario. I have a DataSet populated with a table "Employees" let's say. This table has fields such id, name, email. All I want to do is to display an extra column in my datagrid that will display a checkbox for each row. Note, there is no data associated with this checkbox. I just wanted the user to select some of the Employees from the datagrid by checking the checkbox. Then, when they click the button "Print", I will loop through the datagrid, get the selected ones and print. Anyone can give me some instructions or example of how to do that? I've been looking some people examples that do something similar. But they don't really show how to add an extra column to the datagrid with a checkbox for each record of your already populated dataset. Please, any help will be appreciated. Thanks to all. Anderson Anderson F. afraga22@hotmail.com

      C Offline
      C Offline
      ClayB
      wrote on last edited by
      #2

      You can add an unbound column to your datagrid and use a bool columnstyle for that unbound column. You can download a sample showing how to add an unbound column from: http://www.syncfusion.com/FAQ/WinForms/FAQ\_c44c.asp#q787q Clay Burch www.syncfusion.com

      A 1 Reply Last reply
      0
      • C ClayB

        You can add an unbound column to your datagrid and use a bool columnstyle for that unbound column. You can download a sample showing how to add an unbound column from: http://www.syncfusion.com/FAQ/WinForms/FAQ\_c44c.asp#q787q Clay Burch www.syncfusion.com

        A Offline
        A Offline
        Anderson F
        wrote on last edited by
        #3

        Hello Clay, Thanks a lot. That's a pretty good link. I will try it and I let you know when I get it to work. Thanks again. Anderson Anderson F. afraga22@hotmail.com

        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