Hi @Gani_tpt,
This is the same way you saved all your page data before.
If you want to operate on all pages, you can use this method.
You can use the command below to browse all pages and browse all rows in each page. You can also get the current page before doing this and return there after looping through everything.
protected void btnClear_Click(object sender, EventArgs e)
{
int a = gvCustomer.PageIndex;
//Loop through All Pages
for (int i = 0; i < gvCustomer.PageCount; i++)
{
//Set Page Index
gvCustomer.SetPageIndex(i);
//After Setting Page Index Loop through its Rows
foreach (GridViewRow gvrow in gvCustomer.Rows)
{
if (gvrow.RowType == DataControlRowType.DataRow)
{
CheckBox chk = (CheckBox)gvrow.FindControl("CheckBox1");
chk.Checked = false;
}
}
}
gvCustomer.SetPageIndex(a);
}
Best regards,
Lan Huang
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.