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