ihv got allow paging in my gridview...
i need this in button click event
1.) giridvew total row count .
2.) loop through all the rows in foreach
but its jst wrking for the current gridview page...help
protected void Button5_Click(object sender, EventArgs e)
{
int[] no = new int[GridView2.Rows.Count];
int i = 0;
foreach (GridViewRow row in GridView2.Rows)
{
Label l = (Label)row.FindControl("Label2");
if (l.Text == "Unpaid")
{
int productID = Convert.ToInt32(GridView2.DataKeys[row.RowIndex].Value);
no[i] = productID;
i++;
}
}
)