PagedDataSource Pds = new PagedDataSource(); Pds.DataSource = dv; Pds.AllowPaging = true; Pds.PageSize = 10; int TotalCount = Pds.PageCount;