Controls You Can Use on Web Forms ASP.NET Data Controls DetailsView Control
The DetailsView Web server control enables paging thru the records in the data source using any of the following methods:
- Default paging using built-in paging controls
- Default paging using custom navigation controls
- Custom paging
- Set the control’s AllowPaging property to true.
<asp:detailsview id="planDetails" runat="server"
datasourceid="plans"
allowpaging=true
...
>
or simply
<asp:detailsview id="planDetails" runat="server"
datasourceid="plans"
allowpaging
...
>
The DetailsView control includes properties for customizing the default pager style.
- Within the DetailsView declaration, declare a <PagerSettings> element.
- Within the PagerSettings element, define each of the properties you intend to customize. For syntax, see DetailsView Control Syntax.
<pagersettings
mode="nextprevious"
nextpagetext="Next"
previouspagetext="Back"
position="top"
pagebuttoncount=10 />
- Also within the DetailsView declaration, declare a <PagerStyle> element.
- Within the PagerStyle element, define each of the properties you intend to customize. For syntax, see DetailsView Control Syntax.
<pagerstyle
backcolor="steelblue"
forecolor="beige"
horizontalalign="right" />
Specifying Row Format in a DetailsView Control Allowing Users to Add Rows in a DetailsView Control