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):驗證控件已經綁定的數據源可工作。