Delete using CheckBox in GridView Control |
|
Answered By
Moderator1
on
3/12/2010 12:35:44 AM |
|
|
|
|
Hi,
For Basic GridView Data Manipulation, read the article in the below url.
http://www.aspdotnetcodes.com/Simple_Insert_Update_Delete_GridView_Sample.aspx.
To add checkbox, add a template field column in the GridView and place the checkbox. You need to place a Button outside the Gridview, in the Click event, you need to check whether CheckBox for the row is checked or not using the below code,
foreach (GridViewRow gvrow in GridView1.Rows)
{
CheckBox CheckBox1 = (CheckBox)gvrow.FindControl("CheckBox1");
if (CheckBox1.Checked)
{
//Do your operations here.
}
} |
|
|
|