I have a GridView with paging. When I try to count gridview row with gridview.rows.count, It gives me row count for current page only.
How can I get total rows of G
int a = grdvw.PageIndex; int rowcount=0; for (int i = 0; i < grdvw.PageCount; i++) { grdvw.SetPageIndex(i); foreach (GridViewRow row in grdvw.Rows) { if (row.RowType == DataControlRowType.DataRow) { rowcount++; } } } grdvw.SetPageIndex(a);