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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Checkboxes embedded in a data grid

Checkboxes embedded in a data grid

Scheduled Pinned Locked Moved ASP.NET
csshardwarequestion
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.
  • G Offline
    G Offline
    Gary Hyslop at home
    wrote on last edited by
    #1

    I have a web pages containing a DataGrid control. There are several asp check boxes defined in one of the template columns. I wish to control which checkboxes are checked by disabling some when others are checked. I need to capture an event when a check box is checked or unchecked. When checkboxes are defined directly in a web page the AutoPostBack=true provides such an event. This doesn't work in this situation. Any ideas? Gary Hyslop

    S 1 Reply Last reply
    0
    • G Gary Hyslop at home

      I have a web pages containing a DataGrid control. There are several asp check boxes defined in one of the template columns. I wish to control which checkboxes are checked by disabling some when others are checked. I need to capture an event when a check box is checked or unchecked. When checkboxes are defined directly in a web page the AutoPostBack=true provides such an event. This doesn't work in this situation. Any ideas? Gary Hyslop

      S Offline
      S Offline
      SABhatti
      wrote on last edited by
      #2

      well on itemdatabound you can add client script to the checkboxes and then use the javascript to disable/enable the required checkboxes. You can find their client id in view source. here is how to add client script to check boxes in itemdataboundcommand of datagrid: dim cb as checkbox cb = e.item.findcontrol("checkboxid") 'checkboxid is the server ID of checkbox cb.Attributes.add("onclick","javascript::enabledisableCboxes(this);") you can also check by adding onpropertychange function.. and in in enabledisableCboxes function do whatever you want to do, you will have client ID of the clicked checkbox.. AND if you want to do all this stuff on server then you can force postback onclick or onpropertychange of the check box ----- -- modified at 16:51 Friday 21st October, 2005

      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