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. Web Development
  3. ASP.NET
  4. Can't retrieve the checked value of the checkbox in DataGrid

Can't retrieve the checked value of the checkbox in DataGrid

Scheduled Pinned Locked Moved ASP.NET
wpfwcfhelp
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
    softp_vc
    wrote on last edited by
    #1

    Hi All, Im having a datagrid in which im binding the different columns. the first column is CheckBox. at run time im populating the DataGrid(Obviously), but on checking any of the checkbox doesnt give me that the checkbox is Checked. It always shows that it is false(i.e.) unchecked. I have all the materials please let me know if anybody is having the solution for the problem . the code-behind for retreiving the checked value of the CheckBox is-- foreach(DataGridItem objitem in DGData.Items) { //*this always return the false value value whether CheckBox is checked or not bool flag=((CheckBox)objitem.FindControl("chkSelect_user")).Checked; if(flag) { its very urgent for me. Thanks a lot in advance. Regards, Naveen

    P 1 Reply Last reply
    0
    • S softp_vc

      Hi All, Im having a datagrid in which im binding the different columns. the first column is CheckBox. at run time im populating the DataGrid(Obviously), but on checking any of the checkbox doesnt give me that the checkbox is Checked. It always shows that it is false(i.e.) unchecked. I have all the materials please let me know if anybody is having the solution for the problem . the code-behind for retreiving the checked value of the CheckBox is-- foreach(DataGridItem objitem in DGData.Items) { //*this always return the false value value whether CheckBox is checked or not bool flag=((CheckBox)objitem.FindControl("chkSelect_user")).Checked; if(flag) { its very urgent for me. Thanks a lot in advance. Regards, Naveen

      P Offline
      P Offline
      PhaniKatakam
      wrote on last edited by
      #2

      Naveen, Do one thing, Keep a hidden variable...Before submitting, take the comma seperated values into hidden thru client side script.. if checked - 1 otherwise 0. so.. that u get 1,0,1,0..for N rows for each column. then at the server, u could read hidden variable from Request.form and know which row is checked or not... Hope this helps.. Phani Phani,Virtusa, Hyd

      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