相关文章推荐
英俊的毛衣  ·  [ npm ERR! code 1 ] ...·  3 月前    · 
一直单身的烈酒  ·  vs2019 ...·  7 月前    · 
public ref class GridView : System::Web::UI::WebControls::CompositeDataBoundControl, System::Web::UI::ICallbackEventHandler, System::Web::UI::IPostBackEventHandler, System::Web::UI::WebControls::ICallbackContainer, System::Web::UI::WebControls::IPersistedSelector, System::Web::UI::WebControls::IPostBackContainer
public ref class GridView : System::Web::UI::WebControls::CompositeDataBoundControl, System::Web::UI::ICallbackEventHandler, System::Web::UI::IDataKeysControl, System::Web::UI::IPostBackEventHandler, System::Web::UI::WebControls::ICallbackContainer, System::Web::UI::WebControls::IDataBoundListControl, System::Web::UI::WebControls::IFieldControl, System::Web::UI::WebControls::IPersistedSelector, System::Web::UI::WebControls::IPostBackContainer
[System.Web.UI.ControlValueProperty("SelectedValue")]
public class GridView : System.Web.UI.WebControls.CompositeDataBoundControl, System.Web.UI.ICallbackEventHandler, System.Web.UI.IPostBackEventHandler, System.Web.UI.WebControls.ICallbackContainer, System.Web.UI.WebControls.IPersistedSelector, System.Web.UI.WebControls.IPostBackContainer
[System.Web.UI.ControlValueProperty("SelectedValue")]
public class GridView : System.Web.UI.WebControls.CompositeDataBoundControl, System.Web.UI.ICallbackEventHandler, System.Web.UI.IDataKeysControl, System.Web.UI.IPostBackEventHandler, System.Web.UI.WebControls.ICallbackContainer, System.Web.UI.WebControls.IDataBoundListControl, System.Web.UI.WebControls.IFieldControl, System.Web.UI.WebControls.IPersistedSelector, System.Web.UI.WebControls.IPostBackContainer
[<System.Web.UI.ControlValueProperty("SelectedValue")>]
type GridView = class
    inherit CompositeDataBoundControl
    interface IPostBackContainer
    interface IPostBackEventHandler
    interface ICallbackContainer
    interface ICallbackEventHandler
    interface IPersistedSelector
[<System.Web.UI.ControlValueProperty("SelectedValue")>]
type GridView = class
    inherit CompositeDataBoundControl
    interface IPostBackContainer
    interface IPostBackEventHandler
    interface ICallbackContainer
    interface ICallbackEventHandler
    interface IPersistedSelector
    interface IDataKeysControl
    interface IDataBoundListControl
    interface IDataBoundControl
    interface IFieldControl
Public Class GridView
Inherits CompositeDataBoundControl
Implements ICallbackContainer, ICallbackEventHandler, IPersistedSelector, IPostBackContainer, IPostBackEventHandler
Public Class GridView
Inherits CompositeDataBoundControl
Implements ICallbackContainer, ICallbackEventHandler, IDataBoundListControl, IDataKeysControl, IFieldControl, IPersistedSelector, IPostBackContainer, IPostBackEventHandler
Object
GridView

本主题随附了一个带有源代码的 Visual Studio 网站项目: 下载

以下示例演示如何使用 GridView 控件显示 Microsoft SQL Server中 AdventureWorksLT 示例数据库的 Customers 表中的值。 使用 SqlDataSource 控件检索值。

<asp:sqldatasource id="CustomersSource" selectcommand="SELECT CustomerID, CompanyName, FirstName, LastName FROM SalesLT.Customer" connectionstring="<%$ ConnectionStrings:AWLTConnectionString %>" runat="server"/> <asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="False" emptydatatext="No data available." allowpaging="True" runat="server" DataKeyNames="CustomerID"> <Columns> <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" InsertVisible="False" ReadOnly="True" SortExpression="CustomerID" /> <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName" /> <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" /> <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" /> </Columns> </asp:gridview> <asp:sqldatasource id="CustomersSource" selectcommand="SELECT CustomerID, CompanyName, FirstName, LastName FROM SalesLT.Customer" connectionstring="<%$ ConnectionStrings:AWLTConnectionString %>" runat="server"/> <asp:gridview id="CustomersGridView" datasourceid="CustomersSource" autogeneratecolumns="False" emptydatatext="No data available." allowpaging="True" runat="server" DataKeyNames="CustomerID"> <Columns> <asp:BoundField DataField="CustomerID" HeaderText="CustomerID" InsertVisible="False" ReadOnly="True" SortExpression="CustomerID" /> <asp:BoundField DataField="CompanyName" HeaderText="CompanyName" SortExpression="CompanyName" /> <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" /> <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" /> </Columns> </asp:gridview>

以下示例演示如何使用 GridView 控件和 LinqDataSource 控件,以便编辑记录。

<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="AdventureWorksLTDataClassesDataContext" EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="SalesOrderDetails"> </asp:LinqDataSource> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="SalesOrderID,SalesOrderDetailID" DataSourceID="LinqDataSource1"> <Columns> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" /> <asp:BoundField DataField="SalesOrderID" HeaderText="SalesOrderID" ReadOnly="True" SortExpression="SalesOrderID" /> <asp:BoundField DataField="SalesOrderDetailID" HeaderText="SalesOrderDetailID" InsertVisible="False" ReadOnly="True" SortExpression="SalesOrderDetailID" /> <asp:BoundField DataField="OrderQty" HeaderText="OrderQty" SortExpression="OrderQty" /> <asp:BoundField DataField="ProductID" HeaderText="ProductID" SortExpression="ProductID" /> <asp:BoundField DataField="UnitPrice" HeaderText="UnitPrice" SortExpression="UnitPrice" /> <asp:BoundField DataField="ModifiedDate" HeaderText="ModifiedDate" SortExpression="ModifiedDate" /> </Columns> </asp:GridView> <asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="AdventureWorksLTDataClassesDataContext" EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="SalesOrderDetails"> </asp:LinqDataSource> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="SalesOrderID,SalesOrderDetailID" DataSourceID="LinqDataSource1"> <Columns> <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" /> <asp:BoundField DataField="SalesOrderID" HeaderText="SalesOrderID" ReadOnly="True" SortExpression="SalesOrderID" /> <asp:BoundField DataField="SalesOrderDetailID" HeaderText="SalesOrderDetailID" InsertVisible="False" ReadOnly="True" SortExpression="SalesOrderDetailID" /> <asp:BoundField DataField="OrderQty" HeaderText="OrderQty" SortExpression="OrderQty" /> <asp:BoundField DataField="ProductID" HeaderText="ProductID" SortExpression="ProductID" /> <asp:BoundField DataField="UnitPrice" HeaderText="UnitPrice" SortExpression="UnitPrice" /> <asp:BoundField DataField="ModifiedDate" HeaderText="ModifiedDate" SortExpression="ModifiedDate" /> </Columns> </asp:GridView>

有关演示如何访问单元格中的值的示例,请参阅 GridViewRow

本主题内容:

  • 绑定到数据

  • 自定义用户界面

  • 声明性语法

    控件 GridView 用于显示表中数据源的值。 每列表示一个字段,而每一行表示一条记录。 控件 GridView 支持以下功能:

  • 绑定到数据源控件,例如 SqlDataSource

  • 内置的排序功能。

  • 内置更新和删除功能。

  • 内置分页功能。

  • 内置行选择功能。

  • GridView 编程方式访问对象模型,以动态设置属性、处理事件等。

  • 多个键字段。

  • 超链接列的多个数据字段。

  • 通过主题和样式自定义的外观。

  • 若要了解 ASP.NET 中提供的其他数据绑定控件,请参阅 数据绑定 Web 服务器控件

    如果熟悉 DataGrid .NET Framework 版本 1.0 中的控件,则 GridView 控件是控件的 DataGrid 后续版本。

    控件中的每个 GridView 列都由 一个 DataControlField 对象表示。 默认情况下, AutoGenerateColumns 属性设置为 true ,这会为数据源中的每个字段创建一个 AutoGeneratedField 对象。 然后,每个字段将按照每个字段在 GridView 数据源中的显示顺序呈现为控件中的列。

    还可以手动控制控件中显示的 GridView 列字段,方法是将 AutoGenerateColumns 属性设置为 false ,然后定义自己的列字段集合。 不同的列字段类型确定控件中列的行为。 下表列出了可以使用的不同列字段类型。

    列字段类型

    若要以声明方式定义列字段集合,请先在控件的开始标记和结束 <Columns> 标记之间添加开始标记和结束标记 GridView 。 接下来,列出要在开始标记和结束 <Columns> 标记之间包括的列字段。 指定的列将按列出的顺序添加到 Columns 集合中。 集合 Columns 将所有列字段存储在 控件中,并使你能够以编程方式管理控件中的 GridView 列字段。

    显式声明的列字段可以与自动生成的列字段组合显示。 当同时使用这两个字段时,首先呈现显式声明的列字段,然后呈现自动生成的列字段。

    自动生成的列字段不会添加到集合中 Columns

    绑定到数据

    控件 GridView 可以绑定到数据源控件 ((例如 SqlDataSource 控件或 ObjectDataSource 控件) )或实现 System.Collections.IEnumerable 接口的任何数据源集合,例如 System.Data.DataView System.Collections.ArrayList System.Collections.Generic.List<T> 或其他集合类型。 使用以下方法之一将 GridView 控件绑定到相应的数据源类型:

  • 若要绑定到数据源控件,请将 控件的 GridView 属性设置为 DataSourceID ID 数据源控件的值。 控件 GridView 自动绑定到指定的数据源控件,并可以利用数据源控件的功能来执行排序、更新、删除和分页。 这是绑定到数据的首选方法。

  • 若要绑定到实现 接口的 System.Collections.IEnumerable 数据源,请以编程方式将 GridView 控件的 属性设置为 DataSource 数据源,然后调用 DataBind 方法。 使用此方法时, GridView 控件不提供内置的排序、更新、删除和分页功能。 需要使用适当的事件来提供此功能。

    有关数据绑定的详细信息,请参阅 ASP.NET 数据访问内容映射

    此控件可用于显示用户输入,其中可能包括恶意客户端脚本。 在应用程序中显示之前,请检查从客户端发送的任何信息,以获取可执行脚本、SQL 语句或其他代码。 如果可能,强烈建议先对值进行 HTML 编码,然后再显示在此控件中, ( BoundField 默认情况下) 类 HTML 编码值。 ASP.NET 提供了输入请求验证功能,用于阻止用户输入中的脚本和 HTML。 还提供了验证服务器控件来评估用户输入。 有关详细信息,请参阅 验证控件简介

    控件 GridView 提供了许多内置功能,允许用户对控件中的项进行排序、更新、删除、选择和分页。 当控件 GridView 绑定到数据源控件时,该 GridView 控件可以利用数据源控件的功能并提供自动排序、更新和删除功能。

    控件 GridView 可以支持对其他类型的数据源进行排序、更新和删除。 但是,需要为这些操作提供具有 实现的相应事件处理程序。

    排序允许用户通过单击该列的标题,对控件中的 GridView 项进行特定列的排序。 若要启用排序,请将 属性 AllowSorting 设置为 true

    当单击 或 TemplateField 列字段中的命令名称分别为“编辑”、“删除”和“选择”的按钮 ButtonField 时,将启用自动更新、删除和选择功能。 如果 AutoGenerateDeleteButton AutoGenerateEditButton 、 或 AutoGenerateSelectButton 属性分别设置为 true ,控件 GridView 可以自动添加 CommandField 带有“编辑”、“删除”或“选择”按钮的列字段。

    控件不直接支持 GridView 将记录插入数据源。 但是,可以通过将 GridView 控件与 DetailsView FormView 控件结合使用来插入记录。 有关详细信息,请参阅 DetailsView FormView

    控件可以自动将记录分解为页, GridView 而不是同时显示数据源中的所有记录。 若要启用分页,请将 属性 AllowPaging 设置为 true

    控件 GridView 根据存储在 中 ViewState 的信息在回发时重新创建。 GridView 如果控件包含 TemplateField 或 , CommandField CausesValidation 属性设置为 true ,则 EnableViewState 还必须将 属性设置为 true ,以确保并发数据操作(如更新和删除)应用于相应的行。

    自定义用户界面

    可以通过为控件的不同部分设置样式属性来自定义控件的外观 GridView 。 下表列出了不同的样式属性。

    Style 属性 AlternatingRowStyle 控件中交替数据行的 GridView 样式设置。 设置此属性后,数据行将在设置和 AlternatingRowStyle 设置之间 RowStyle 交替显示。 EditRowStyle 控件中正在编辑的行的 GridView 样式设置。 EmptyDataRowStyle 当数据源不包含任何记录时,控件中显示的 GridView 空数据行的样式设置。 FooterStyle 控件的页脚行的 GridView 样式设置。 HeaderStyle 控件标题行的 GridView 样式设置。 PagerStyle 控件的寻呼行的 GridView 样式设置。 RowStyle 控件中数据行的 GridView 样式设置。 AlternatingRowStyle 同时设置 属性时,数据行在设置和 AlternatingRowStyle 设置之间 RowStyle 交替显示。 SelectedRowStyle 控件中所选行的 GridView 样式设置。 SortedAscendingCellStyle 控件中数据排序依据的数据列的 GridView 样式设置。 设置此样式时,样式 (,例如,当数据按升序排序时,突出显示的列) 将应用于单元格。 SortedAscendingHeaderStyle 控件中数据排序依据的数据列的 GridView 样式设置。 设置此样式时,当数据按升序排序时,控件的 GridView 标头上将放置一个箭头,指示数据按升序排序。 SortedDescendingCellStyle 控件中数据排序依据的数据列的 GridView 样式设置。 设置此样式时,样式 (例如,当数据按降序排序时,突出显示的列) 应用于单元格。 SortedDescendingHeaderStyle 控件中数据排序依据的数据列的 GridView 样式设置。 设置此样式后,当数据按降序排序时,会指向 的 GridView 标头上放置一个向下箭头。

    还可以显示或隐藏控件的不同部分。 下表列出了控制显示或隐藏哪些部分的属性。

    AllowSorting="True|False"     AutoGenerateColumns="True|False"     AutoGenerateDeleteButton="True|False"     AutoGenerateEditButton="True|False"     AutoGenerateSelectButton="True|False"     BackColor="color name|#dddddd"     BackImageUrl="uri"     BorderColor="color name|#dddddd"     BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge| Inset|Outset"     BorderWidth="size"     Caption="string"     CaptionAlign="NotSet|Top|Bottom|Left|Right"     CellPadding="integer"     CellSpacing="integer"     CssClass="string"     DataKeyNames="string"     DataMember="string"     DataSource="string"     DataSourceID="string"     EditIndex="integer"     EmptyDataText="string"     Enabled="True|False"     EnableSortingAndPagingCallbacks="True|False"     EnableTheming="True|False"     EnableViewState="True|False"     Font-Bold="True|False"     Font-Italic="True|False"     Font-Names="string"     Font-Overline="True|False"     Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium| Large|X-Large|XX-Large"     Font-Strikeout="True|False"     Font-Underline="True|False"     ForeColor="color name|#dddddd"     GridLines="None|Horizontal|Vertical|Both"     Height="size"     HorizontalAlign="NotSet|Left|Center|Right|Justify"     ID="string"     OnDataBinding="DataBinding event handler"     OnDataBound="DataBound event handler"     OnDisposed="Disposed event handler"     OnInit="Init event handler"     OnLoad="Load event handler"     OnPageIndexChanged="PageIndexChanged event handler"     OnPageIndexChanging="PageIndexChanging event handler"     OnPreRender="PreRender event handler"     OnRowCancelingEdit="RowCancelingEdit event handler"     OnRowCommand="RowCommand event handler"     OnRowCreated="RowCreated event handler"     OnRowDataBound="RowDataBound event handler"     OnRowDeleted="RowDeleted event handler"     OnRowDeleting="RowDeleting event handler"     OnRowEditing="RowEditing event handler"     OnRowUpdated="RowUpdated event handler"     OnRowUpdating="RowUpdating event handler"     OnSelectedIndexChanged="SelectedIndexChanged event handler"     OnSelectedIndexChanging="SelectedIndexChanging event handler"     OnSorted="Sorted event handler"     OnSorting="Sorting event handler"     OnUnload="Unload event handler"     PageIndex="integer"     PagerSettings-FirstPageImageUrl="uri"     PagerSettings-FirstPageText="string"     PagerSettings-LastPageImageUrl="uri"     PagerSettings-LastPageText="string"     PagerSettings-Mode="NextPrevious|Numeric|NextPreviousFirstLast| NumericFirstLast"     PagerSettings-NextPageImageUrl="uri"     PagerSettings-NextPageText="string"     PagerSettings-PageButtonCount="integer"     PagerSettings-Position="Bottom|Top|TopAndBottom"     PagerSettings-PreviousPageImageUrl="uri"     PagerSettings-PreviousPageText="string"     PagerSettings-Visible="True|False"     PageSize="integer"     RowHeaderColumn="string"     runat="server"     SelectedIndex="integer"     ShowFooter="True|False"     ShowHeader="True|False"     SkinID="string"     Style="string"     TabIndex="integer"     ToolTip="string"     UseAccessibleHeader="True|False"     Visible="True|False"     Width="size"         <AlternatingRowStyle />         <Columns>                 <asp:BoundField                     AccessibleHeaderText="string"                     ApplyFormatInEditMode="True|False"                     ConvertEmptyStringToNull="True|False"                     DataField="string"                     DataFormatString="string"                     FooterText="string"                     HeaderImageUrl="uri"                     HeaderText="string"                     HtmlEncode="True|False"                     InsertVisible="True|False"                     NullDisplayText="string"                     ReadOnly="True|False"                     ShowHeader="True|False"                     SortExpression="string"                     Visible="True|False"                         <ControlStyle />                         <FooterStyle />                         <HeaderStyle />                         <ItemStyle />                 </asp:BoundField>                 <asp:ButtonField                     AccessibleHeaderText="string"                     ButtonType="Button|Image|Link"                     CausesValidation="True|False"                     CommandName="string"                     DataTextField="string"                     DataTextFormatString="string"                     FooterText="string"                     HeaderImageUrl="uri"                     HeaderText="string"                     ImageUrl="uri"                     InsertVisible="True|False"                     ShowHeader="True|False"                     SortExpression="string"                     Text="string"                     ValidationGroup="string"                     Visible="True|False"                         <ControlStyle />                         <FooterStyle />                         <HeaderStyle />                         <ItemStyle />                 </asp:ButtonField>                 <asp:CheckBoxField                     AccessibleHeaderText="string"                     DataField="string"                     FooterText="string"                     HeaderImageUrl="uri"                     HeaderText="string"                     InsertVisible="True|False"                     ReadOnly="True|False"                     ShowHeader="True|False"                     SortExpression="string"                     Text="string"                     Visible="True|False"                         <ControlStyle />                         <FooterStyle />                         <HeaderStyle />                         <ItemStyle />                 </asp:CheckBoxField>                 <asp:CommandField                     AccessibleHeaderText="string"                     ButtonType="Button|Image|Link"                     CancelImageUrl="uri"                     CancelText="string"                     CausesValidation="True|False"                     DeleteImageUrl="uri"                     DeleteText="string"                     EditImageUrl="uri"                     EditText="string"                     FooterText="string"                     HeaderImageUrl="uri"                     HeaderText="string"                     InsertImageUrl="uri"                     InsertText="string"                     InsertVisible="True|False"                     NewImageUrl="uri"                     NewText="string"                     SelectImageUrl="uri"                     SelectText="string"                     ShowCancelButton="True|False"                     ShowDeleteButton="True|False"                     ShowEditButton="True|False"                     ShowHeader="True|False"                     ShowInsertButton="True|False"                     ShowSelectButton="True|False"                     SortExpression="string"                     UpdateImageUrl="uri"                     UpdateText="string"                     ValidationGroup="string"                     Visible="True|False"                         <ControlStyle />                         <FooterStyle />                         <HeaderStyle />                         <ItemStyle />                 </asp:CommandField>                 <asp:DynamicField                     AccessibleHeaderText="string"                     ApplyFormatInEditMode="True|False"                     ConvertEmptyStringToNull="True|False"                     DataField="string"                     DataFormatString="string"                     FooterText="string"                     HeaderImageUrl="uri"                     HeaderText="string"                     HtmlEncode="True|False"                     InsertVisible="True|False"                     NullDisplayText="string"                     ShowHeader="True|False"                     UIHint="string"                     Visible="True|False"                         <ControlStyle />                         <FooterStyle />                         <HeaderStyle />                         <ItemStyle />                 </asp:DynamicField>                 <asp:HyperLinkField                     AccessibleHeaderText="string"                     DataNavigateUrlFields="string"                     DataNavigateUrlFormatString="string"                     DataTextField="string"                     DataTextFormatString="string"                     FooterText="string"                     HeaderImageUrl="uri"                     HeaderText="string"                     InsertVisible="True|False"                     NavigateUrl="uri"                     ShowHeader="True|False"                     SortExpression="string"                     Target="string|_blank|_parent|_search|_self|_top"                     Text="string"                     Visible="True|False"                         <ControlStyle />                         <FooterStyle />                         <HeaderStyle />                         <ItemStyle />                 </asp:HyperLinkField>                 <asp:ImageField                     AccessibleHeaderText="string"                     AlternateText="string"                     ConvertEmptyStringToNull="True|False"                     DataAlternateTextField="string"                     DataAlternateTextFormatString="string"                     DataImageUrlField="string"                     DataImageUrlFormatString="string"                     FooterText="string"                     HeaderImageUrl="uri"                     HeaderText="string"                     InsertVisible="True|False"                     NullDisplayText="string"                     NullImageUrl="uri"                     ReadOnly="True|False"                     ShowHeader="True|False"                     SortExpression="string"                     Visible="True|False"                         <ControlStyle />                         <FooterStyle />                         <HeaderStyle />                         <ItemStyle />                 </asp:ImageField>                 <asp:TemplateField                     AccessibleHeaderText="string"                     ConvertEmptyStringToNull="True|False"                     FooterText="string"                     HeaderImageUrl="uri"                     HeaderText="string"                     InsertVisible="True|False"                     ShowHeader="True|False"                     SortExpression="string"                     Visible="True|False"                             <ControlStyle />                             <FooterStyle />                             <HeaderStyle />                             <ItemStyle />                         <AlternatingItemTemplate> <!-- child controls -->                         </AlternatingItemTemplate>                         <EditItemTemplate> <!-- child controls -->                         </EditItemTemplate>                         <FooterTemplate> <!-- child controls -->                         </FooterTemplate>                         <HeaderTemplate> <!-- child controls -->                         </HeaderTemplate>                         <InsertItemTemplate> <!-- child controls -->                         </InsertItemTemplate>                         <ItemTemplate> <!-- child controls -->                         </ItemTemplate>                 </asp:TemplateField>         </Columns>         <EditRowStyle />         <EmptyDataRowStyle />         <EmptyDataTemplate> <!-- child controls -->         </EmptyDataTemplate>         <FooterStyle />         <HeaderStyle />         <PagerSettings             FirstPageImageUrl="uri"             FirstPageText="string"             LastPageImageUrl="uri"             LastPageText="string"             Mode="NextPrevious|Numeric|NextPreviousFirstLast| NumericFirstLast"             NextPageImageUrl="uri"             NextPageText="string"             OnPropertyChanged="PropertyChanged event handler"             PageButtonCount="integer"             Position="Bottom|Top|TopAndBottom"             PreviousPageImageUrl="uri"             PreviousPageText="string"             Visible="True|False"         <PagerStyle />         <PagerTemplate> <!-- child controls -->         </PagerTemplate>         <RowStyle />         <SelectedRowStyle /> </asp:GridView>
  •