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. Visual Basic
  4. VB 2005 Gridview question

VB 2005 Gridview question

Scheduled Pinned Locked Moved Visual Basic
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.
  • J Offline
    J Offline
    john_paul
    wrote on last edited by
    #1

    I have a gridview in a VB2005 project that contains a checkbox. In VB2003 I used a datagrid and I have the code to read the datagrid to determine how many and which boxes were checked. I am having trouble converting my code to use a gridview. How do you in VB2005 read a gridview and determine if the checkbox was checked? Thanks

    K 1 Reply Last reply
    0
    • J john_paul

      I have a gridview in a VB2005 project that contains a checkbox. In VB2003 I used a datagrid and I have the code to read the datagrid to determine how many and which boxes were checked. I am having trouble converting my code to use a gridview. How do you in VB2005 read a gridview and determine if the checkbox was checked? Thanks

      K Offline
      K Offline
      Kschuler
      wrote on last edited by
      #2

      There are many ways to do this. Probably the easiest way would be to add a DataGridViewCheckBoxColumn to your GridView. Then set the FalseValue property and the TrueValue property of this column. Then set the DataPropertyName property to the field you want to bind this control to from your DataTable/DataSet or whatever you are binding to the DataGrid. Now when the box is checked that field in the DataTable/DataSet will be set to whatever value you set as the TrueValue property. I hope this at least will put you on the right track. Good luck.

      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