i want to store checked index of gridview and move these seleced values move to another table on submit
My code is:
private void fillGrid()
{
string post1 = "Center";
GridView1.DataSource = c1.SelectDs("Select UserName, Password from tbl_Agents Where Post='" + post1 + "'");
GridView1.DataBind();
}
protected void GetSelectedRecords(object sender, EventArgs e)
{
DataTable dt = new DataTable();
foreach (GridViewRow row in GridView1.Rows)
{
if (row.RowType == DataControlRowType.DataRow)
{
CheckBox chkRow = (row.Cells[0].FindControl("chkRow") as CheckBox);
if (chkRow.Checked)
{
string text1= row.Cells[1].Text;
string text2= row.Cells[2].Text;
}
}
}
} Go to the complete details ...