Reputation: 675
I Have GridView with both visible and invisible rows in it,
But i just want count of only visible Rows in that grid
i have tried this
int rowCount = gv_SPAvailable.Rows.Count(row => row.IsVisible);
But i could not get, is there any other way, any one please help
Upvotes: 0
Views: 9140
Reputation: 675
Also these code is working fine
int numVisible = 0;
foreach(GridViewRow row in gv_SPAvailable.Rows)
{
if(row.Visible == true)
{
numVisible += 1;
}
}
Upvotes: 1
Reputation: 32561
Try this:
int rowCount = gv_SPAvailable.Rows.GetRowCount(DataGridViewElementStates.Visible);
Upvotes: 5