DataPager PagerTemplate

Datapager example

DataPager is a independent paging control in asp.net 3.5 which can be used with any databound controls which implments  IPageableContainer interface.

DataPager properties:

PageSize

Size of the rows in a sinlge page to be displayed.

QueryStringField:

Query string name which is suffied on the url to control paging

PagedControlId

Id of the databound control to which paging has to be done. Fields template controls how the paging navigation elements like Next,Previous, Numeric Navigator are displayed.

There is another field type called TemplatePagerFIeld which can be used to display paging elements in your own way. In the following sample TemplatePagerField is used to display current page number. 

DataPager example code with TemplatePagerField

		







Page

<%# Container.TotalRowCount>0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %>

of

<%# Math.Ceiling ((double)Container.TotalRowCount / Container.PageSize) %>

(<%# Container.TotalRowCount%>

records)














 
blog comments powered by Disqus