ASP.NET/Grid View

维基教科书,自由的教学读本

语法声明[编辑]

<asp:GridView  
    AccessKey="string"  
    AllowPaging="True|False"  
    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>

GridView属性[编辑]

共有134个属性:

  • DataKeys:为数组,包含了数据绑定后每行的key值。当GridView控件的DataKeyNames设置后,每行会创建一个DataKey对象,并形成控件的DataKeys的collection。
  • SelectedDataKey:选中行的DataKey对象。
  • SelectedValue:选中行的数据键值。
  • AccessKey:HTML accesskey属性,规定激活(使元素获得焦点)元素的ALT快捷键。
  • Adapter:Gets the browser-specific adapter for the control.
  • AllowCustomPaging:自定义分页还是自动分页
  • AllowPaging:是否分页
  • AllowSorting:受否可排序
  • AlternatingRowStyle:引用到TableItemStyle对象,用于设置alternating data rows的外观
  • AppRelativeTemplateSourceDirectory:Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control.
  • Attributes:Gets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control.
  • AutoGenerateColumns:是否bound fields根据数据源中的每个字段自动创建
  • AutoGenerateDeleteButton:是否CommandField字段列中自动创建一个Delete按钮。
  • AutoGenerateEditButton:是否CommandField字段列中自动创建一个Edit按钮。
  • AutoGenerateSelectButton:是否CommandField字段列中自动创建一个Select按钮。
  • BackColor:读/写背景色
  • BackImageUrl:读/写背景图片的Url
  • BindingContainer:得到本控件的数据绑定控件。
  • BorderColor:读写边界颜色
  • BorderStyle:读写边界的style
  • BorderWidth:读写边界宽度
  • BottomPagerRow:得到底部的页面行
  • Caption:读写控件的HTML标题元素,用于残障辅助阅读
  • CaptionAlign:读写标题水平/垂直位置
  • CellPadding:读写cell内容与cell边界之间的空间
  • CellSpacing:读写cell之间的空间
  • ChildControlsCreated:读取子控件是否已经创建
  • ClientID:得到控件的ID
  • ClientIDMode:读写产生控件ID的算法名字
  • ClientIDRowSuffix:读写
  • ClientIDRowSuffixDataKeys:读
  • ClientIDSeparator:得到分隔符
  • Columns:得到DataControlField对象的collection
  • ColumnsGenerator:读写自动产生列的控件
  • Context:得到HttpContext对象
  • Controls:得到子控件的collection
  • ControlStyle:得到控件style
  • ControlStyleCreated:得到一个值表示Style对象是否已创建
  • CssClass:读写CSS类
  • DataItemContainer:得到命名容器实现IDataItemContainer
  • DataKeyNames:读写一个array,包含了主键字段
  • DataKeys:得到DataKey对象的array,表示了每行的数据键值。
  • DataKeysContainer:得到一个命名容器实现了IDataKeysControl
  • DataMember:读写数据的list的名字。
  • DataSource:读写数据源的名字
  • DataSourceID:读写数据源控件的ID
  • DataSourceObject:得到实现了IDataSource的对象的名字
  • DeleteMethod:读写删除数据的方法的名字
  • DesignMode:得到
  • EditIndex:读写正在编辑的行索引
  • EditRowStyle:得到TableItemStyle对象的引用,可用于设置编辑行的外观
  • EmptyDataRowStyle:得到TableItemStyle对象的引用,可用于设置没有绑定的空行的外观
  • EmptyDataTemplate:读写空行的用户定制的内容
  • EmptyDataText:读写空行中显示的文本值
  • Enabled:读写gv控件是否使能。
  • EnableModelValidation:读写是否在插入/修改时,一个validator控件是否可以处理异常
  • EnablePersistedSelection:读写选中行是基于索引还是数据键值。
  • EnableSortingAndPagingCallbacks:读写是否允许客户端的排序或分页的回调函数
  • EnableTheming:读写是否允许themes
  • EnableViewState:读写是否控件及其任何子控件保持view state
  • Events:得到本控件的事件处理函数的list
  • Font:得到控件的字体属性
  • FooterRow:得到控件的底栏行
  • FooterStyle:得到一个TableItemStyle对象的引用,可用于设置底栏外观
  • ForeColor:读写前景色(如文本颜色)
  • GridLines:读写gridline style
  • HasAttributes:得到控件是否有attributes set.
  • HasChildViewState Gets:得到子控件是否有保存的view-state设置
  • HeaderRow:得到头部行对象
  • HeaderStyle:得到对TableItemStyle对象的引用用于设置头部行的外观。
  • Height:读写高度
  • HorizontalAlign:读写控件在页面的水平对齐
  • ID:读写控件的ID
  • IdSeparator:得到控件ID的分隔符
  • Initialized:得到控件是否完成初始化
  • InsertMethod:读写插入方法的名字
  • IsBoundUsingDataSourceID:得到是否DataSourceID属性已经设置
  • IsChildControlStateCleared:得到被包含的控件是否有控件状态
  • IsDataBindingAutomatic:得到是否数据绑定是自动化的
  • IsEnabled:得到控件是否enabled
  • IsTrackingViewState:得到控件是否把changes保存到view state.
  • IsUsingModelBinders:得到是否使用model binding
  • IsViewStateEnabled:得到是否控件view state使能
  • ItemType:读写强类型数据绑定时数据项类型的名字
  • LoadViewStateByID:得到是否控件参与了按照ID而不是index装入其view state
  • NamingContainer:得到控件的naming container, 用于创建独一无二命名空间
  • Page:得到控件所在的Page实例
  • PageCount:得到分页显示的页数
  • PageIndex:读写当前分页的页号
  • PagerSettings:得到PagerSettings对象的引用,可用于设置pager buttons的性质
  • PagerStyle:得到TableItemStyle对象的引用,能够设置pager row的外观.
  • PagerTemplate:读写pager row的定制内容
  • PageSize:读写分页包含的行数
  • Parent:得到控件的父控件
  • RenderingCompatibility: Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with.
  • RequiresDataBinding Gets or sets a value indicating whether the DataBind() method should be called.
  • RowHeaderColumn Gets or sets the name of the column to use as the column header for the GridView control. This property is provided to make the control more accessible to users of assistive technology devices.
  • Rows Gets a collection of GridViewRow objects that represent the data rows in a GridView control.
  • RowStyle:得到TableItemStyle对象的引用,可用于设置普通行的外观
  • SelectArguments:得到DataSourceSelectArguments对象,用于从数据源对象获取数据
  • SelectedDataKey:得到DataKey对象,包含了当前选中行的数据键值。
  • SelectedIndex:读写控件的选中行的index
  • SelectedPersistedDataKey Gets or sets the data-key value for the persisted selected item in a GridView control.
  • SelectedRow Gets a reference to a GridViewRow object that represents the selected row in the control.
  • SelectedRowStyle:得到TableItemStyle对象的引用,可用于设置选中的行的外观
  • SelectedValue:得到被选中行的数据键值。
  • SelectMethod:读取数据的方法的名字
  • ShowFooter:读写是否显示底栏行
  • ShowHeader:读写是否显示顶栏行
  • ShowHeaderWhenEmpty:读写在一列的数据为空时是否显示顶栏
  • Site:获取主机的信息
  • SkinID:读写控件的皮肤
  • SortDirection:获取列的排序的方向
  • SortedAscendingCellStyle:读写CSS style用于一列升序显示
  • SortedAscendingHeaderStyle:读写CSS style用于升序显示的一列的顶栏
  • SortedDescendingCellStyle:读写CSS style用于一列降序显示
  • SortedDescendingHeaderStyle:读写CSS style用于降序显示的一列的顶栏
  • SortExpression:获取列排序的表达式
  • Style:获取text attributes的collection,用于作为控件的outer tag的style attribute绘制。
  • SupportsDisabledAttribute:获取一个值表示当控件的IsEnabled property为假时,是否disabled attribute。
  • TabIndex:读写tab index
  • TagKey:得到HtmlTextWriterTag值。
  • TagName:得到控件的tag的名字。
  • TemplateControl:读写到template的引用
  • TemplateSourceDirectory:得到Page或UserControl的虚拟目录,包含当前控件。
  • ToolTip:读写当鼠标在控件上时显示的文本提示内容
  • TopPagerRow:得到一个对象表示top pager row
  • UniqueID:得到一个独一无二、层次性的限定的标识符
  • UpdateMethod:读写修改属的方法的名字
  • UseAccessibleHeader:读写一个值表示是否在可访问格式下绘制空间头部。
  • ValidateRequestMode:读写一个值,指示是否在浏览器端检查用户的输入
  • ViewState:得到一个状态信息的字典,以便在多次加载同一个页面时保存或恢复可视信息
  • ViewStateIgnoresCase:得到一个值,指示是否StateBag对象是大小写不敏感
  • ViewStateMode:读写view-state mode
  • VirtualItemCount:读写数据源中items的数量
  • Visible:读写一个值指示是否绘制控件
  • Width:读写控件的宽度。

事件[编辑]

约有24个事件:

  • CallingDataMethods:当数据成员被调用时发生(从 BaseDataBoundControl 继承。)
  • CreatingModelDataSource:当ModelDataSource对象被创建时发生。(从 BaseDataBoundControl 继承。)
  • DataBinding 当服务器控件绑定到数据源时发生。(从 Control 继承。)
  • DataBound 在服务器控件绑定到数据源后发生。(从 BaseDataBoundControl 继承。)
  • Disposed 当从内存释放服务器控件时发生,这是请求 ASP.NET 页时服务器控件生存期的最后阶段。(从 Control 继承。)
  • Init 当服务器控件初始化时发生;初始化是控件生存期的第一步。(从 Control 继承。)
  • Load 当服务器控件加载到 Page 对象中时发生。(从 Control 继承。)
  • PageIndexChanged 在单击某一页导航按钮时,但在 GridView 控件处理分页操作之后发生。
  • PageIndexChanging 在单击某一页导航按钮时,但在 GridView 控件处理分页操作之前发生。
  • PreRender 在加载 Control 对象之后、呈现之前发生。(从 Control 继承。)
  • RowCancelingEdit 单击编辑模式中某一行的“取消”按钮以后,在该行退出编辑模式之前发生。
  • RowCommand 当单击 GridView 控件中的按钮时发生。
  • RowCreated 在 GridView 控件中创建行时发生。
  • RowDataBound 在 GridView 控件中将数据行绑定到数据时发生。
  • RowDeleted 在单击某一行的“删除”按钮时,但在 GridView 控件删除该行之后发生。
  • RowDeleting 在单击某一行的“删除”按钮时,但在 GridView 控件删除该行之前发生。
  • RowEditing 发生在单击某一行的“编辑”按钮以后,GridView 控件进入编辑模式之前。
  • RowUpdated 发生在单击某一行的“更新”按钮,并且 GridView 控件对该行进行更新之后。
  • RowUpdating 发生在单击某一行的“更新”按钮以后,GridView 控件对该行进行更新之前。
  • SelectedIndexChanged 发生在单击某一行的“选择”按钮,GridView 控件对相应的选择操作进行处理之后。
  • SelectedIndexChanging 发生在单击某一行的“选择”按钮以后,GridView 控件对相应的选择操作进行处理之前。
  • Sorted 在单击用于列排序的超链接时,但在 GridView 控件对相应的排序操作进行处理之后发生。
  • Sorting 在单击用于列排序的超链接时,但在 GridView 控件对相应的排序操作进行处理之前发生。
  • Unload 当服务器控件从内存中卸载时发生。(从 Control 继承。)

Methods[编辑]

约117个方法:

  • AddAttributesToRender(HtmlTextWriter):增加HTML attributes与styles,用于绘制指定的HtmlTextWriterTag.
  • AddedControl(Control, Int32):向Controls collection增加一个控件后的回调
  • AddParsedSubObject(Object):通知服务器控件一个元素被分析并增加到控件的ControlCollection对象。
  • ApplyStyle(Style):把style覆盖到控件
  • ApplyStyleSheetSkin(Page):用于在page style sheetstyle属性现实的properties
  • BeginRenderTracing(TextWriter, Object):开始绘制数据的设计时追溯
  • BuildProfileTree(String, Boolean):收集控件的信息并交付给Trace属性
  • ClearCachedClientID()
  • ClearChildControlState()
  • ClearChildState():删除所有子控件的view-state与control-state信息。
  • ClearChildViewState():删除所有子控件的view-state信息
  • ClearEffectiveClientIDMode():设置ClientIDMode属性
  • ConfirmInitState():设置控件的初始化状态
  • CopyBaseAttributes(WebControl):把参数所引用的控件的未被Style object封装的Attributes复制到当前控件
  • CreateChildControls()
  • CreateChildControls(IEnumerable, Boolean)
  • CreateChildTable()
  • CreateColumns(PagedDataSource, Boolean):创建列字段的set
  • CreateControlCollection()
  • CreateControlStyle():创建缺省的style
  • CreateDataSourceSelectArguments():创建DataSourceSelectArguments对象,包含了传递给数据源的实参。
  • CreateRow(Int32, Int32, DataControlRowType, DataControlRowState)
  • DataBind()
  • DataBind(Boolean)
  • DataBindChildren()
  • DeleteRow(Int32)
  • Dispose()
  • EndRenderTracing(TextWriter, Object):结束设计时绘制数据的追溯
  • EnsureChildControls():确认是否包含子控件,如果没有则创建子控件。
  • EnsureDataBound():确认数据绑定。
  • EnsureID():创建控件标识符,此前它没有标识符
  • Equals(Object)
  • ExtractRowValues(IOrderedDictionary, GridViewRow, Boolean, Boolean):从指定行抽取字段值,存入IOrderedDictionary对象。
  • FindControl(String):在当前命名容器内搜索指定id的控件
  • FindControl(String, Int32)
  • Focus():设定焦点
  • GetCallbackResult():返回回调事件的结果
  • GetCallbackScript(IButtonControl, String):对一个执行排序操作的按钮,创建回调脚本
  • GetData():获取DataSourceView对象
  • GetDataSource():获取IDataSource接口
  • GetDesignModeState():得到设计时控件的数据
  • GetHashCode()
  • GetRouteUrl(Object)
  • GetRouteUrl(RouteValueDictionary)
  • GetRouteUrl(String, Object)
  • GetRouteUrl(String, RouteValueDictionary)
  • GetType():返回实例的类型
  • GetUniqueIDRelativeTo(Control):返回指定控件的UniqueID属性的前缀部分
  • HasControls():确定是否包含任何子控件
  • HasEvents()
  • InitializePager(GridViewRow, Int32, PagedDataSource):初始化pager行显示
  • InitializeRow(GridViewRow, DataControlField[])
  • IsBindableType(Type):确定指定数据类型可绑定到一列
  • IsLiteralContent():确定控件保持字面内容
  • LoadControlState(Object):装入空间的属性状态,即使EnableViewState属性为假
  • LoadViewState(Object):装入以前保存的view state
  • MapPathSecure(String):获取一个虚拟路径的物理路径
  • MarkAsDataBound():设置控件的view state为已经绑定数据
  • MemberwiseClone():创建控件的浅拷贝
  • MergeStyle(Style):复制控件的非空元素的指定style
  • OnBubbleEvent(Object, EventArgs):确定服务器控件的事件向上传给该页面UI控件
  • OnCreatingModelDataSource(CreatingModelDataSourceEventArgs)
  • OnDataBinding(EventArgs)
  • OnDataBound(EventArgs)
  • OnDataPropertyChanged():在DataMember, DataSource, DataSourceID属性改变后,重新绑定数据
  • OnDataSourceViewChanged(Object, EventArgs)
  • OnInit(EventArgs)
  • OnLoad(EventArgs)
  • OnPageIndexChanged(EventArgs)
  • OnPageIndexChanging(GridViewPageEventArgs)
  • OnPagePreLoad(Object, EventArgs)
  • OnPreRender(EventArgs)
  • OnRowCancelingEdit(GridViewCancelEditEventArgs)
  • OnRowCommand(GridViewCommandEventArgs)
  • OnRowCreated(GridViewRowEventArgs)
  • OnRowDataBound(GridViewRowEventArgs)
  • OnRowDeleted(GridViewDeletedEventArgs)
  • OnRowDeleting(GridViewDeleteEventArgs)
  • OnRowEditing(GridViewEditEventArgs)
  • OnRowUpdated(GridViewUpdatedEventArgs)
  • OnRowUpdating(GridViewUpdateEventArgs)
  • OnSelectedIndexChanged(EventArgs)
  • OnSelectedIndexChanging(GridViewSelectEventArgs)
  • OnSorted(EventArgs)
  • OnSorting(GridViewSortEventArgs)
  • OnUnload(EventArgs)
  • OpenFile(String):得到一个流用于读取file.PerformDataBinding(IEnumerable)并绑定到控件
  • PerformSelect():从数据源获取数据
  • PrepareControlHierarchy():建立起控件架构。
  • RaiseBubbleEvent(Object, EventArgs):把事件的源与信息赋值给控件的父控件
  • RaiseCallbackEvent(String):创建在GetCallbackEventReference(Control, String, String, String, Boolean)方法中的回调处理器的实参
  • RaisePostBackEvent(String):当控件回传服务器时,抛出控件的适当事件
  • RemovedControl(Control):子控件被删除后调用
  • Render(HtmlTextWriter):使用指定的HtmlTextWriter对象绘制控件
  • RenderBeginTag(HtmlTextWriter):绘制控件的HTML opening tag到指定的writer.
  • RenderChildren(HtmlTextWriter):绘制子控件。
  • RenderContents(HtmlTextWriter):绘制内容
  • enderControl(HtmlTextWriter):输出服务器控件。
  • RenderControl(HtmlTextWriter, ControlAdapter):使用提供的ControlAdapter输出控件内容
  • RenderEndTag(HtmlTextWriter):绘制空间的HTML closing tag
  • ResolveAdapter():得到control adapter
  • ResolveClientUrl(String):得到可用于浏览器的URL
  • ResolveUrl(String):转化URL为用户可用的形式
  • SaveControlState():保存控件状态,即使EnableViewState属性为假
  • SaveViewState():装入以前保存的view state
  • SelectRow(Int32)
  • SetDesignModeState(IDictionary):设定为设计时数据
  • SetEditRow(Int32):把一行设定为编辑状态
  • SetPageIndex(Int32):设定当前页
  • SetRenderMethodDelegate(RenderMethod):把事件处理器委托给控件
  • SetTraceData(Object, Object):设定设计时的追溯数据
  • SetTraceData(Object, Object, Object):设定设计时的追溯数据
  • Sort(String, SortDirection):使用排序表达式、排序方向对控件排序。
  • ToString()
  • TrackViewState():追溯view-state的改变,存放在控件的StateBag对象中,并可通过ViewState属性访问。
  • UpdateRow(Int32, Boolean):修改指定行。
  • ValidateDataSource(Object):验证控件已经绑定的数据源可工作。