Export (0) Print
Expand All

FormView.PagerTemplate Property

Note: This property is new in the .NET Framework version 2.0.

Gets or sets the custom content for the pager row in a FormView control.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

[TemplateContainerAttribute(typeof(FormView))] 
public:
virtual property ITemplate^ PagerTemplate {
	ITemplate^ get ();
	void set (ITemplate^ value);
}
/** @property */
public ITemplate get_PagerTemplate ()

/** @property */
public void set_PagerTemplate (ITemplate value)

public function get PagerTemplate () : ITemplate

public function set PagerTemplate (value : ITemplate)

Property Value

A System.Web.UI.ITemplate that contains the custom content for the pager row. The default value is null, which indicates that this property is not set.

A pager row is displayed in a FormView control when the paging feature is enabled (when the AllowPaging property is set to true). The pager row contains the controls that allow the user to navigate to the different pages in the control. Instead of using the built-in pager row user interface (UI), you can define your own UI by using the PagerTemplate property.

NoteNote

When the PagerTemplate property is set it overrides the built-in pager row UI.

To specify a custom template for the pager row, first place <PagerTemplate> tags between the opening and closing tags of the FormView control. You can then list the contents of the template between the opening and closing <PagerTemplate> tags. To control the appearance of the pager row, use the PagerStyle property.

Typically, button controls are added to the pager template to perform the paging operations. The FormView control performs a paging operation when a button control with its CommandName property set to "Page" is clicked. The button's CommandArgument property determines the type of paging operation to perform. The following table lists the command argument values supported by the FormView control.

CommandArgument value

Description

"Next"

Navigates to the next page.

"Prev"

Navigates to the previous page.

"First"

Navigates to the first page.

"Last"

Navigates to the last page.

Integer value

Navigates to the specified page number.

The following example demonstrates how to define a custom pager template.

No code example is currently available or this language may not be supported.

Windows 98, Windows 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0

Community Additions

ADD
Show:
© 2014 Microsoft