Bhanu
Bhanu

Reputation: 49

Gridview row count property

is there any property for gridview last page rows count in asp.net clientside

        GridView1.PageIndex = GridView1.PageCount - 1;
        var currentCount = (GridView1.PageIndex) * GridView1.PageSize +GridView1.Rows.Count;
        lblGridviewTotalCount.Text = currentCount.ToString();

Specifically i want the last page count

Thanks in advance

Upvotes: 0

Views: 5601

Answers (3)

Majid
Majid

Reputation: 14253

For counting number of last page's rows,use this code:

int currentCount = GridView1.Rows.Count-((GridView1.PageCount-1) * GridView1.PageSize);

Upvotes: 1

Shailesh
Shailesh

Reputation: 990

Try this one.hear you will get re-mender.That is your last page value.

int LastPageCount =Convert.ToInt32(GridView1.Rows.Count) %  Convert.ToInt32(GridView1.PageSize)

Upvotes: 0

Mahmoud Farahat
Mahmoud Farahat

Reputation: 5485

you can use a HiddenField each time to store count of the current page and use this hiddenField in client side

remember you can always get number of rows in gridview (HTML Table) using javascript/jquery , like this $('#grid_view_table_id tr').length

Upvotes: 0

Related Questions