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. how to remove the rows from the gridview control when check box is unchecked

how to remove the rows from the gridview control when check box is unchecked

Scheduled Pinned Locked Moved ASP.NET
csharptutorialasp-net
4 Posts 4 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.
  • D Offline
    D Offline
    developerit
    wrote on last edited by
    #1

    hi iam using asp.net with c# in my gridview 1st column is templatefield which contains check box control, default i set to check, iam displaying data at page load event but when i unchecked the checkbox then that row should be remove from gridview . can you give me example which helps me

    M B C 3 Replies Last reply
    0
    • D developerit

      hi iam using asp.net with c# in my gridview 1st column is templatefield which contains check box control, default i set to check, iam displaying data at page load event but when i unchecked the checkbox then that row should be remove from gridview . can you give me example which helps me

      M Offline
      M Offline
      m dhu
      wrote on last edited by
      #2

      Check.. This may help you link

      1 Reply Last reply
      0
      • D developerit

        hi iam using asp.net with c# in my gridview 1st column is templatefield which contains check box control, default i set to check, iam displaying data at page load event but when i unchecked the checkbox then that row should be remove from gridview . can you give me example which helps me

        B Offline
        B Offline
        Brij
        wrote on last edited by
        #3

        So for that, use rowcommand event and when user uncheck the checkbox then remove it from db and bind the grid again. for details on rowcommand event, have a look to the link Click here

        Cheers!! Brij Check my latest Article :Exploring ASP.NET Validators

        1 Reply Last reply
        0
        • D developerit

          hi iam using asp.net with c# in my gridview 1st column is templatefield which contains check box control, default i set to check, iam displaying data at page load event but when i unchecked the checkbox then that row should be remove from gridview . can you give me example which helps me

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

          for (int i = 0; i < GridView1.Rows.Count; i++) { CheckBox ck=(CheckBox)GridView1.Rows[i].Controls[0]; if(!ck.Check) { GridView1.Rows[i].visible=false; } }

          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