Ranjeet,
u can get idea from below code..
foreach (GridViewRow row in gvAdmin.Rows) //traversing the each row of gridview
{
CheckBox checkbox = (CheckBox)row.FindControl("chkRows");
if (checkbox.Checked == true) //Checking the checkbox is checked or not!!
{
int iUserId = Convert.ToInt32(gvAdmin.DataKeys[row.RowIndex].Value); // Retreive the Employee ID
// Pass the value of the selected Employye ID to the update ommand for soft delete.
sqlDSshowUser.UpdateParameters["pk_user_id"].DefaultValue = iUserId.ToString();
i = sqlDSshowUser.Update(); //i is used to store no. of rows affected
}
}
if (i > 0)
{
///record found
}
else //run when no record is mark checked for delete
{
//select the record .. }
}
Savari_Arm, if this helps please login to Mark As Answer. | Alert Moderator