Suggérer une traduction
 
Suggestions d'autres utilisateurs :

progress indicator
Aucune autre suggestion.
Cliquez pour évaluer et commenter
MSDN
MSDN Library
Développement .NET
.NET Framework 4
Espaces de noms System.Web
System.Web.UI.WebControls
PagerSettings, classe
Réduire tout/Développer tout Réduire tout
Affichage du contenu :  côte à côteAffichage du contenu : côte à côte
.NET Framework Class Library
PagerSettings Class

Represents the properties of the paging controls in a control that supports pagination. This class cannot be inherited.

System..::.Object
  System.Web.UI.WebControls..::.PagerSettings

Namespace:  System.Web.UI.WebControls
Assembly:  System.Web (in System.Web.dll)
Visual Basic
<TypeConverterAttribute(GetType(ExpandableObjectConverter))> _
Public NotInheritable Class PagerSettings _
    Implements IStateManager
C#
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public sealed class PagerSettings : IStateManager
Visual C++
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public ref class PagerSettings sealed : IStateManager
F#
[<Sealed>]
[<TypeConverterAttribute(typeof(ExpandableObjectConverter))>]
type PagerSettings =  
    class
        interface IStateManager
    end

The PagerSettings type exposes the following members.

  NameDescription
Public methodPagerSettingsInitializes a new instance of the PagerSettings class.
Top
  NameDescription
Public propertyFirstPageImageUrlGets or sets the URL to an image to display for the first-page button.
Public propertyFirstPageTextGets or sets the text to display for the first-page button.
Public propertyLastPageImageUrlGets or sets the URL to an image to display for the last-page button.
Public propertyLastPageTextGets or sets the text to display for the last-page button.
Public propertyModeGets or sets the mode in which to display the pager controls in a control that supports pagination.
Public propertyNextPageImageUrlGets or sets the URL to an image to display for the next-page button.
Public propertyNextPageTextGets or sets the text to display for the next-page button.
Public propertyPageButtonCountGets or sets the number of page buttons to display in the pager when the Mode property is set to the Numeric or NumericFirstLast value.
Public propertyPositionGets or sets a value that specifies the location where the pager is displayed.
Public propertyPreviousPageImageUrlGets or sets the URL to an image to display for the previous-page button.
Public propertyPreviousPageTextGets or sets the text to display for the previous page button.
Public propertyVisibleGets or sets a value indicating whether the paging controls are displayed in a control that supports pagination.
Top
  NameDescription
Public methodEquals(Object)Determines whether the specified Object is equal to the current Object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as a hash function for a particular type. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringRetrieves the string representation of a PagerSettings object. (Overrides Object..::.ToString()()().)
Top
  NameDescription
Public eventPropertyChangedOccurs when a property of a PagerSettings object changes values.
Top
  NameDescription
Explicit interface implemetationPrivate propertyIStateManager..::.IsTrackingViewStateGets a value that indicates whether the server control is tracking its view state changes.
Explicit interface implemetationPrivate methodIStateManager..::.LoadViewStateInfrastructure. Loads the previously saved view state of the PagerSettings object.
Explicit interface implemetationPrivate methodIStateManager..::.SaveViewStateInfrastructure. Saves the current view state of the PagerSettings object.
Explicit interface implemetationPrivate methodIStateManager..::.TrackViewStateInfrastructure. Marks the starting point at which to begin tracking and saving view state changes to the PagerSettings object.
Top

Controls that support pagination (such as the GridView, DetailsView, and FormView controls) can display a set of controls called the pager that allows the user to navigate the pages within the control. The PagerSettings class is used by these controls to represent the properties of the pager. In general, the PagerSettings object is stored in the PagerSettings property of the control. You can customize the pager by setting the properties of the PagerSettings object.

The pager supports several different display modes. To specify the mode in which to display the pager, set the Mode property. The following table describes the different modes.

Mode

Description

NextPrevious

Previous-page and next-page buttons.

NextPreviousFirstLast

Previous-page, next-page, first-page, and last -page buttons.

Numeric

Numbered link buttons to access pages directly.

NumericFirstLast

Numbered-link, first-link, and last-link buttons.

When the Mode property is set to the NextPrevious, NextPreviousFirstLast, or NumericFirstLast value you can customize the text of the non-numeric buttons by setting the properties shown in the following table.

Property

Description

FirstPageText

Text for the first-page button.

PreviousPageText

Text for the previous-page button.

NextPageText

Text for the next-page button.

LastPageText

Text for the last-page button.

As an alternative, you can also display images for the non-numeric buttons by setting the properties as shown in the following table.

Property

Description

FirstPageImageUrl

The URL to an image to display for the first-page button.

PreviousPageImageUrl

The URL to an image to display for the previous-page button.

NextPageImageUrl

The URL to an image to display for the next-page button.

LastPageImageUrl

The URL to an image to display for the last-page button.

NoteNote

When an image property is set, the corresponding text property acts as the alternate text for the image. For example, when the FirstPageImageUrl property is set, the text that is specified by the FirstPageText property is displayed as the alternate text for the image. On browsers that support ToolTips, this text is also displayed as a ToolTip for the corresponding button.

When the Mode property is set to the Numeric or NumericFirstLast value, you can specify the number of page buttons to display in the pager by setting the PageButtonCount property.

The pager can be displayed at the top, the bottom, or both the top and bottom of a control. To specify the position of the pager, set the Position property. To show or hide the pager, use the Visible property.

The following code example demonstrates how to use the PagerSettings object that is contained in the PagerSettings property to customize the text of the buttons that are displayed in the pager row of a GridView control.

Visual Basic

<%@ Page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  >
  <head runat="server">
    <title>PagerSetting Example</title>
</head>
<body>
    <form id="form1" runat="server">

      <h3>PagerSetting Example</h3>

        <asp:gridview id="CustomerGridView"
          datasourceid="CustomerDataSource"
          autogeneratecolumns="true"
          datakeynames="CustomerID"  
          allowpaging="true"
          runat="server">

          <pagersettings mode="NextPreviousFirstLast"
            firstpagetext="First"
            lastpagetext="Last"
            nextpagetext="Next"
            previouspagetext="Prev"   
            position="Bottom"/> 

        </asp:gridview>

        <br/>

        <asp:label id="MessageLabel"
          forecolor="Red"
          runat="server"/>

        <!-- This example uses Microsoft SQL Server and connects  -->
        <!-- to the Northwind sample database. Use an ASP.NET     -->
        <!-- expression to retrieve the connection string value   -->
        <!-- from the Web.config file.                            -->
        <asp:sqldatasource id="CustomerDataSource"
          selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
          connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
          runat="server"/>

      </form>
  </body>
</html>

C#

<%@ Page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  >
  <head runat="server">
    <title>PagerSetting Example</title>
</head>
<body>
    <form id="form1" runat="server">

      <h3>PagerSetting Example</h3>

        <asp:gridview id="CustomerGridView"
          datasourceid="CustomerDataSource"
          autogeneratecolumns="true"
          datakeynames="CustomerID"  
          allowpaging="true"
          runat="server">

          <pagersettings mode="NextPreviousFirstLast"
            firstpagetext="First"
            lastpagetext="Last"
            nextpagetext="Next"
            previouspagetext="Prev"   
            position="Bottom"/> 

        </asp:gridview>

        <br/>

        <asp:label id="MessageLabel"
          forecolor="Red"
          runat="server"/>

        <!-- This example uses Microsoft SQL Server and connects  -->
        <!-- to the Northwind sample database. Use an ASP.NET     -->
        <!-- expression to retrieve the connection string value   -->
        <!-- from the Web.config file.                            -->
        <asp:sqldatasource id="CustomerDataSource"
          selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
          connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
          runat="server"/>

      </form>
  </body>
</html>

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role not supported), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Bibliothèque de classes .NET Framework
PagerSettings, classe

Représente les propriétés des contrôles de pagination dans un contrôle qui prend en charge la pagination. Cette classe ne peut pas être héritée.

System..::.Object
  System.Web.UI.WebControls..::.PagerSettings

Espace de noms :  System.Web.UI.WebControls
Assembly :  System.Web (dans System.Web.dll)
Visual Basic
<TypeConverterAttribute(GetType(ExpandableObjectConverter))> _
Public NotInheritable Class PagerSettings _
    Implements IStateManager
C#
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public sealed class PagerSettings : IStateManager
VisualC++
[TypeConverterAttribute(typeof(ExpandableObjectConverter))]
public ref class PagerSettings sealed : IStateManager
F#
[<Sealed>]
[<TypeConverterAttribute(typeof(ExpandableObjectConverter))>]
type PagerSettings =  
    class
        interface IStateManager
    end

Le type PagerSettings expose les membres suivants.

  NomDescription
Méthode publiquePagerSettingsInitialise une nouvelle instance de la classe PagerSettings.
Début
  NomDescription
Propriété publiqueFirstPageImageUrlObtient ou définit l'URL d'une image à afficher pour le bouton de première page.
Propriété publiqueFirstPageTextObtient ou définit le texte à afficher pour le bouton de première page.
Propriété publiqueLastPageImageUrlObtient ou définit l'URL d'une image à afficher pour le bouton de dernière page.
Propriété publiqueLastPageTextObtient ou définit le texte à afficher pour le bouton de dernière page.
Propriété publiqueModeObtient ou définit le mode dans lequel afficher les contrôles de pagineur dans un contrôle qui prend en charge la pagination.
Propriété publiqueNextPageImageUrlObtient ou définit l'URL d'une image à afficher pour le bouton de page suivante.
Propriété publiqueNextPageTextObtient ou définit le texte à afficher pour le bouton de page suivante.
Propriété publiquePageButtonCountObtient ou définit le nombre de boutons de page à afficher dans le pagineur lorsque la propriété Mode a la valeur Numeric ou NumericFirstLast.
Propriété publiquePositionObtient ou définit une valeur qui spécifie l'emplacement où le pagineur est affiché.
Propriété publiquePreviousPageImageUrlObtient ou définit l'URL d'une image à afficher pour le bouton de page précédente.
Propriété publiquePreviousPageTextObtient ou définit le texte à afficher pour le bouton de page précédente.
Propriété publiqueVisibleObtient ou définit une valeur indiquant si les contrôles de pagination sont affichés dans un contrôle qui prend en charge la pagination.
Début
  NomDescription
Méthode publiqueEquals(Object)Détermine si l'Object spécifié est égal à l'Object en cours. (Hérité de Object.)
Méthode protégéeFinalizeAutorise un objet à tenter de libérer des ressources et d'exécuter d'autres opérations de netto***ge avant qu'il ne soit récupéré par l'opération garbage collection. (Hérité de Object.)
Méthode publiqueGetHashCodeSert de fonction de hachage pour un type particulier. (Hérité de Object.)
Méthode publiqueGetTypeObtient le Type de l'instance actuelle. (Hérité de Object.)
Méthode protégéeMemberwiseCloneCrée une copie superficielle de l'objet Object actif. (Hérité de Object.)
Méthode publiqueToStringRécupère la représentation sous forme de chaîne d'un objet PagerSettings. (Substitue Object..::.ToString()()().)
Début
  NomDescription
Événement publicPropertyChangedSe produit lorsqu'une propriété d'un objet PagerSettings modifie des valeurs.
Début
  NomDescription
Implémentation d'interface explicitePropriété privéeIStateManager..::.IsTrackingViewStateObtient une valeur qui indique si le contrôle serveur effectue le suivi des modifications apportées à son état d'affichage.
Implémentation d'interface expliciteMéthode privéeIStateManager..::.LoadViewStateInfrastructure. Charge l'état d'affichage enregistré précédemment de l'objet PagerSettings.
Implémentation d'interface expliciteMéthode privéeIStateManager..::.SaveViewStateInfrastructure. Enregistre l'état d'affichage actuel de l'objet PagerSettings.
Implémentation d'interface expliciteMéthode privéeIStateManager..::.TrackViewStateInfrastructure. Marque le point de départ du suivi et de l'enregistrement des modifications d'état d'affichage apportées à l'objet PagerSettings.
Début

Les contrôles qui prennent en charge la pagination (tels que les contrôles GridView, DetailsView et FormView) peuvent afficher un ensemble de contrôles appelé le pagineur qui permet à l'utilisateur de parcourir les pages du contrôle. La classe PagerSettings est utilisée par ces contrôles pour représenter les propriétés du pagineur. En général, l'objet PagerSettings est stocké dans la propriété PagerSettings du contrôle. Vous pouvez personnaliser le pagineur en définissant les propriétés de l'objet PagerSettings.

Le pagineur prend en charge différents modes d'affichage. Pour spécifier le mode dans lequel afficher le pagineur, définissez la propriété Mode. Le tableau suivant décrit les différents modes.

Mode

Description

NextPrevious

Boutons de page précédente et de page suivante.

NextPreviousFirstLast

Boutons de page précédente, de page suivante, de première page et de dernière page.

Numeric

Boutons de lien numérotés pour accéder directement aux pages.

NumericFirstLast

Boutons de lien numérotés, de premier lien et de dernier lien.

Lorsque la propriété Mode a la valeur NextPrevious NextPreviousFirstLast ou NumericFirstLast, vous pouvez personnaliser le texte des boutons non numérotés en définissant les propriétés affichées dans le tableau suivant.

Propriété

Description

FirstPageText

Texte du bouton de première page.

PreviousPageText

Texte du bouton de page précédente.

NextPageText

Texte du bouton de page suivante.

LastPageText

Texte du bouton de dernière page.

Une autre possibilité consiste à afficher des images de boutons non numérotés en définissant les propriétés comme indiqué dans le tableau suivant.

Propriété

Description

FirstPageImageUrl

URL d'une image à afficher pour le bouton de première page.

PreviousPageImageUrl

URL d'une image à afficher pour le bouton de page précédente.

NextPageImageUrl

URL d'une image à afficher pour le bouton de page suivante.

LastPageImageUrl

URL d'une image à afficher pour le bouton de dernière page.

RemarqueRemarque

Lorsqu'une propriété d'image est définie, la propriété Text correspondante agit en tant que texte de remplacement pour l'image. Par exemple, lorsque la propriété FirstPageImageUrl est définie, le texte spécifié par la propriété FirstPageText est affiché en tant que texte de remplacement pour l'image. Dans les navigateurs qui prennent en charge la fonctionnalité Info-bulles, ce texte s'affiche également sous forme d'info-bulle pour le bouton correspondant.

Lorsque la propriété Mode a la valeur Numeric ou NumericFirstLast, vous pouvez spécifier le nombre de boutons de page à afficher dans le pagineur en définissant la propriété PageButtonCount.

Le pagineur peut être affiché en haut, en bas ou en haut et en bas d'un contrôle. Pour spécifier la position du pagineur, définissez la propriété Position. Pour afficher ou masquer le pagineur, utilisez la propriété Visible.

L'exemple de code suivant illustre l'utilisation de l'objet PagerSettings contenu dans la propriété PagerSettings pour personnaliser le texte des boutons affichés dans la ligne de pagineur d'un contrôle GridView.

Visual Basic

<%@ Page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  >
  <head runat="server">
    <title>PagerSetting Example</title>
</head>
<body>
    <form id="form1" runat="server">

      <h3>PagerSetting Example</h3>

        <asp:gridview id="CustomerGridView"
          datasourceid="CustomerDataSource"
          autogeneratecolumns="true"
          datakeynames="CustomerID"  
          allowpaging="true"
          runat="server">

          <pagersettings mode="NextPreviousFirstLast"
            firstpagetext="First"
            lastpagetext="Last"
            nextpagetext="Next"
            previouspagetext="Prev"   
            position="Bottom"/> 

        </asp:gridview>

        <br/>

        <asp:label id="MessageLabel"
          forecolor="Red"
          runat="server"/>

        <!-- This example uses Microsoft SQL Server and connects  -->
        <!-- to the Northwind sample database. Use an ASP.NET     -->
        <!-- expression to retrieve the connection string value   -->
        <!-- from the Web.config file.                            -->
        <asp:sqldatasource id="CustomerDataSource"
          selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
          connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
          runat="server"/>

      </form>
  </body>
</html>

C#

<%@ Page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html  >
  <head runat="server">
    <title>PagerSetting Example</title>
</head>
<body>
    <form id="form1" runat="server">

      <h3>PagerSetting Example</h3>

        <asp:gridview id="CustomerGridView"
          datasourceid="CustomerDataSource"
          autogeneratecolumns="true"
          datakeynames="CustomerID"  
          allowpaging="true"
          runat="server">

          <pagersettings mode="NextPreviousFirstLast"
            firstpagetext="First"
            lastpagetext="Last"
            nextpagetext="Next"
            previouspagetext="Prev"   
            position="Bottom"/> 

        </asp:gridview>

        <br/>

        <asp:label id="MessageLabel"
          forecolor="Red"
          runat="server"/>

        <!-- This example uses Microsoft SQL Server and connects  -->
        <!-- to the Northwind sample database. Use an ASP.NET     -->
        <!-- expression to retrieve the connection string value   -->
        <!-- from the Web.config file.                            -->
        <asp:sqldatasource id="CustomerDataSource"
          selectcommand="Select [CustomerID], [CompanyName], [Address], [City], [PostalCode], [Country] From [Customers]"
          connectionstring="<%$ ConnectionStrings:NorthWindConnectionString%>" 
          runat="server"/>

      </form>
  </body>
</html>

.NET Framework

Pris en charge dans : 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 ou ultérieur, Windows XP SP3, Windows XP SP2 Édition x64, Windows Server 2008 (installation minimale non prise en charge), Windows Server 2008 R2 (installation minimale prise en charge avec SP1 ou version ultérieure), Windows Server 2003 SP2

Le .NET Framework ne prend pas en charge toutes les versions de chaque plateforme. Pour obtenir la liste des versions prises en charge, consultez Configuration requise du .NET Framework.
Tous les membres static (Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.
Contenu de la communauté   Qu'est-ce que le Contenu de la communauté ?
Ajouter du contenu RSS  Annotations
Processing
© 2012 Microsoft. Tous droits réservés. Conditions d'utilisation | Marques | Confidentialité
Page view tracker