We will temporarily disable paging and bind the grid again so that we now have access to all the records in the data source, and not just the current records.
When a gridview is bound to all records, you can iterate through the rows of gridview.
As soon as we finish our task, we will turn on paging again and regroup the grid.
Here is a way to handle your condition:
protected void Page_Load(object sender, EventArgs e) { GridView2.AllowPaging = false; GridView2.DataBind();
source share