I have a gridview (gvClient) containing checkboxes (chkSelect). I have enabled paging for same grid and I have lots of data to show. But I am facing the problem, that while retrieving all data from gridview, I am getting only current page gridview data. My code:
foreach (GridViewRow gvrClient in gvClient.Rows) // gvClient.Rows not giving all gridview rows
{
cbSelect = (CheckBox)gvrClient.FindControl("chkSelect");
if (cbSelect.Checked == true)
{
//Operations
}
}
I got following solution on google to use, but it is not working.
gvClient.AllowPaging=false;
gvClient.DataBind();
foreach (GridViewRow gvrClient in gvClient.Rows) // gvClient.Rows not giving all gridview rows
{
cbSelect = (CheckBox)gvrClient.FindControl("chkSelect");
if (cbSelect.Checked == true)
{
//Operations
}
}
gvClient.AllowPaging=true;
gvClient.DataBind();
Any help on this?