You need to point your data source to the correct type to which it is bound. Just using strings will not always give you the total in the data source. Take a look at this example:
<asp:GridView ID="GridView1" runat="server"
AllowPaging="true" PageSize="3">
</asp:GridView>
And in the code behind:
var fruit = new List<string>()
{ "banana", "orange", "apple", "strawberry", "melon", "grape" }
GridView1.DataSource = fruit;
GridView1.DataBind();
int rowsCount = GridView1.Rows.Count;
int dataCount = ((List<string>)GridView1.DataSource).Count;
, , "3", . . , , . , .