i want to foreach in a gridview for first 10 the rows in a gidview but ,total coloum is 20. in 1st page 10 and 2nd page 10...if CheckBox check all only select first 10 rows .
foreach (GridViewRow row in gvStatus.Rows)
{
CheckBox Check = (CheckBox)row.FindControl("ChkSelect");
if (Check.Checked)
{
}
Khargesh RajputPosted Mar 13, 2015, 5:36 AM
use select ROW_NUMBER() OVER (ORDER BY id) AS Row from table
and bind Row in gridview on s.no. or any label
then
// find text label of Row(integer) column and check
if(Row<=10)
{
}