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. deleting data base columns depends on check box value in a datagrid

deleting data base columns depends on check box value in a datagrid

Scheduled Pinned Locked Moved ASP.NET
databasehelpquestion
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.
  • P Offline
    P Offline
    peter rankel
    wrote on last edited by
    #1

    hi all i need help from all of u ,my question is,i add checkbox in datagrid and check some or all check box in datagrid and click delete button then those datagrid rows are delete from database. Thanx in advance your peter

    M 1 Reply Last reply
    0
    • P peter rankel

      hi all i need help from all of u ,my question is,i add checkbox in datagrid and check some or all check box in datagrid and click delete button then those datagrid rows are delete from database. Thanx in advance your peter

      M Offline
      M Offline
      mehnazash
      wrote on last edited by
      #2

      According to what i understood,this is how u can implement foreach (DataGridItem dg in this.dgApproval.Items) { int i = 0; //u use a for loop like this to find the template column of checkbox in data grid if(((CheckBox)(dg.FindControl("CheckBox1"))).Checked == true) { //here i am retreiving the second column of datagrid as i neeeded it //first column in data grid is the 0th column string build_desc1=dg.Cells[1].Text.ToString(); //do what u want here... like i have written update query here string query; string query2; query = "update build_master set approval_flag ="+ i +" where build_desc = '"+ build_desc1+"' "; } //make sure you bind the grid again to reflect the changes BindGrid(); } Happy Programming Jiny -- modified at 8:54 Friday 23rd June, 2006

      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