Quantcast
Channel: ASP.NET AJAX + Ajax Control Toolkit (ACT)
Viewing all articles
Browse latest Browse all 5678

Convert Multiple pages DataGrid to DataTable

$
0
0

Hi,

Please help,

How to read the all the pages in the GridView.

Now I can able to get only the current page of the grid.

But My Grid has 1,2,3..10 pages... (pages count changes dynamically)

so want to count the number of pages in the Grid and to do loop in all the rows in every pages of the grid

--------------------------------------------------------------------------------------------------------------------------------------

// Only looping the current page of the Grid... Want to loop all the rows int he maximum ages of the grid

foreach (GridViewRow grd1Row in gvSelected.Rows)
{
DataRow dtRow1 = dt.NewRow();

dtRow1[0] = grd1Row.Cells[1].Text.Replace(" ", "");

for (int k = 1; k < grd1Row.Cells.Count - 1; k++)
{

dtRow1[k] = grd1Row.Cells[k + 1].Text.Replace("&nbsp;", "");
}

dt.Rows.Add(dtRow1);

}
}
}

gvSelected.DataKeyNames = new string[] { ViewState["textKey"].ToString(), ViewState["valueKey"].ToString() };

gvSelected.DataSource = dt;




Viewing all articles
Browse latest Browse all 5678

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>