Gridview1.DataSource=dt; GridView1.DataBind(); If(//here am checking rows if any match found it will enter in to the if condition and this works fine//) { gridview1.DeleteRow(j); }
'The GridView 'Gridview1' fired event RowDeleting which wasn't handled.'
protected void gridview1_RowDeleting(object sender, GridViewDeleteEventArgs e) { int ID = (int)gridview1.DataKeys[e.RowIndex].Value; // primary key // you can write code here to delete record using ID // use sql query to delete data //e.g String strQuery = 'delete from table where table.id = ' + ID; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)