Hi!
how to delete multiple records in data grid using checkboxes and delete button. i place checkboxes to all columns and delete button is placed in bottom of the datagrid. when user check checkboxes and click the delete button that selected rows are delted. please give a code to do that. urgent sir anybody can help me.
Thanks.
Loading
Dipa AhujaPosted Apr 3, 2010, 12:19 PM
http://www.c-sharpcorner.com/Forums/ShowMessages.aspx?ThreadID=68092
ajay rajuPosted Apr 5, 2010, 2:55 AM
Nikhil MahajanPosted Apr 2, 2010, 4:27 AM
1. by using 3.5 method and using sqldata source which is very simple... but b y this way u can delete only one by one data.
2. method is to delte bulk of data..
for this u have applied checkbox list or u can put radiobutton list whatever u like...
just calculate the no of record on delete button..
and put foreach loop simple..
here is code to delete
foreach (GridViewRow row in GridView1.Rows) \\ ur gridview id
{
if (row.RowType == DataControlRowType.DataRow) \\ data in gridview
{
if(((RadioButtonList)row.FindControl("RadioButtonList1")).SelectedText="yes") \\ur radiobuttonlist/checkbox control {
\\ put here delete command
}
}
}