DataGridTableStyle 類別

定義

代表 DataGrid 控制項在執行階段中繪製的資料表。Represents the table drawn by the DataGrid control at run time.

public ref class DataGridTableStyle : System::ComponentModel::Component, System::Windows::Forms::IDataGridEditingService
public class DataGridTableStyle : System.ComponentModel.Component, System.Windows.Forms.IDataGridEditingService
type DataGridTableStyle = class
    inherit Component
    interface IDataGridEditingService
Public Class DataGridTableStyle
Inherits Component
Implements IDataGridEditingService
繼承
DataGridTableStyle
實作

範例

下列程式碼範例會建立兩個 @no__t 0 實例,並將每個物件的 MappingName 設定為 DataSetDataTableTableNameThe following code example creates two DataGridTableStyle instances and sets the MappingName of each object to the TableName of a DataTable in a DataSet. 然後,此範例會將 DataGridColumnStyle 物件新增至每個 @no__t 2 的 GridColumnStylesCollectionThe example then adds DataGridColumnStyle objects to the GridColumnStylesCollection of each DataGridTableStyle. 如需執行的範例,請參閱 System.Windows.Forms.DataGrid 範例。For an example that runs, see the System.Windows.Forms.DataGrid example.

void AddCustomDataTableStyle()
{
   
   /* Create a new DataGridTableStyle and set
         its MappingName to the TableName of a DataTable. */
   DataGridTableStyle^ ts1 = gcnew DataGridTableStyle;
   ts1->MappingName = "Customers";
   
   /* Add a GridColumnStyle and set its MappingName 
         to the name of a DataColumn in the DataTable. 
         Set the HeaderText and Width properties. */
   DataGridColumnStyle^ boolCol = gcnew DataGridBoolColumn;
   boolCol->MappingName = "Current";
   boolCol->HeaderText = "IsCurrent Customer";
   boolCol->Width = 150;
   ts1->GridColumnStyles->Add( boolCol );
   
   // Add a second column style.
   DataGridColumnStyle^ TextCol = gcnew DataGridTextBoxColumn;
   TextCol->MappingName = "custName";
   TextCol->HeaderText = "Customer Name";
   TextCol->Width = 250;
   ts1->GridColumnStyles->Add( TextCol );
   
   // Create the second table style with columns.
   DataGridTableStyle^ ts2 = gcnew DataGridTableStyle;
   ts2->MappingName = "Orders";
   
   // Change the colors.
   ts2->ForeColor = Color::Yellow;
   ts2->AlternatingBackColor = Color::Blue;
   ts2->BackColor = Color::Blue;
   
   // Create new DataGridColumnStyle objects.
   DataGridColumnStyle^ cOrderDate = gcnew DataGridTextBoxColumn;
   cOrderDate->MappingName = "OrderDate";
   cOrderDate->HeaderText = "Order Date";
   cOrderDate->Width = 100;
   ts2->GridColumnStyles->Add( cOrderDate );
   PropertyDescriptorCollection^ pcol = this->BindingContext[ myDataSet,"Customers.custToOrders" ]->GetItemProperties();
   DataGridColumnStyle^ csOrderAmount = gcnew DataGridTextBoxColumn( pcol[ "OrderAmount" ],"c",true );
   csOrderAmount->MappingName = "OrderAmount";
   csOrderAmount->HeaderText = "Total";
   csOrderAmount->Width = 100;
   ts2->GridColumnStyles->Add( csOrderAmount );
   
   // Add the DataGridTableStyle objects to the collection.
   myDataGrid->TableStyles->Add( ts1 );
   myDataGrid->TableStyles->Add( ts2 );
}

private void AddCustomDataTableStyle()
   {
      /* Create a new DataGridTableStyle and set
      its MappingName to the TableName of a DataTable. */
      DataGridTableStyle ts1 = new DataGridTableStyle();
      ts1.MappingName = "Customers";

      /* Add a GridColumnStyle and set its MappingName 
      to the name of a DataColumn in the DataTable. 
      Set the HeaderText and Width properties. */
      
      DataGridColumnStyle boolCol = new DataGridBoolColumn();
      boolCol.MappingName = "Current";
      boolCol.HeaderText = "IsCurrent Customer";
      boolCol.Width = 150;
      ts1.GridColumnStyles.Add(boolCol);
      
      // Add a second column style.
      DataGridColumnStyle TextCol = new DataGridTextBoxColumn();
      TextCol.MappingName = "custName";
      TextCol.HeaderText = "Customer Name";
      TextCol.Width = 250;
      ts1.GridColumnStyles.Add(TextCol);


      // Create the second table style with columns.
      DataGridTableStyle ts2 = new DataGridTableStyle();
      ts2.MappingName = "Orders";
      // Change the colors.
      ts2.ForeColor = Color.Yellow;
      ts2.AlternatingBackColor = Color.Blue;
      ts2.BackColor = Color.Blue;
      
      // Create new DataGridColumnStyle objects.
      DataGridColumnStyle cOrderDate = 
      new DataGridTextBoxColumn();
      cOrderDate.MappingName = "OrderDate";
      cOrderDate.HeaderText = "Order Date";
      cOrderDate.Width = 100;
      ts2.GridColumnStyles.Add(cOrderDate);

      PropertyDescriptorCollection pcol = this.BindingContext
      [myDataSet, "Customers.custToOrders"].GetItemProperties();
      
      DataGridColumnStyle csOrderAmount = 
      new DataGridTextBoxColumn(pcol["OrderAmount"], "c", true);
      csOrderAmount.MappingName = "OrderAmount";
      csOrderAmount.HeaderText = "Total";
      csOrderAmount.Width = 100;
      ts2.GridColumnStyles.Add(csOrderAmount);

      // Add the DataGridTableStyle objects to the collection.
      myDataGrid.TableStyles.Add(ts1);
      myDataGrid.TableStyles.Add(ts2);
   }

Private Sub AddCustomDataTableStyle()
    ' Create a new DataGridTableStyle and set
    ' its MappingName to the TableName of a DataTable. 
    Dim ts1 As New DataGridTableStyle()
    ts1.MappingName = "Customers"
    
    ' Add a GridColumnStyle and set its MappingName
    ' to the name of a DataColumn in the DataTable.
    ' Set the HeaderText and Width properties. 
    
    Dim boolCol As New DataGridBoolColumn()
    boolCol.MappingName = "Current"
    boolCol.HeaderText = "IsCurrent Customer"
    boolCol.Width = 150
    ts1.GridColumnStyles.Add(boolCol)
    
    ' Add a second column style.
    Dim TextCol As New DataGridTextBoxColumn()
    TextCol.MappingName = "custName"
    TextCol.HeaderText = "Customer Name"
    TextCol.Width = 250
    ts1.GridColumnStyles.Add(TextCol)

    ' Create the second table style with columns.
    Dim ts2 As New DataGridTableStyle()
    ts2.MappingName = "Orders"

    ' Change the colors.
    ts2.ForeColor = Color.Yellow
    ts2.AlternatingBackColor = Color.Blue
    ts2.BackColor = Color.Blue
    
    ' Create new DataGridColumnStyle objects.
    Dim cOrderDate As New DataGridTextBoxColumn()
    cOrderDate.MappingName = "OrderDate"
    cOrderDate.HeaderText = "Order Date"
    cOrderDate.Width = 100
    ts2.GridColumnStyles.Add(cOrderDate)
    
    Dim pcol As PropertyDescriptorCollection = Me.BindingContext(myDataSet, "Customers.custToOrders").GetItemProperties()
    
    Dim csOrderAmount As New DataGridTextBoxColumn(pcol("OrderAmount"), "c", True)
    csOrderAmount.MappingName = "OrderAmount"
    csOrderAmount.HeaderText = "Total"
    csOrderAmount.Width = 100
    ts2.GridColumnStyles.Add(csOrderAmount)

    ' Add the DataGridTableStyle objects to the collection.
    myDataGrid.TableStyles.Add(ts1)
    myDataGrid.TableStyles.Add(ts2)
End Sub

備註

[@No__t-0] 控制項會以方格的形式來顯示資料。The System.Windows.Forms.DataGrid control displays data in the form of a grid. @No__t-0 是代表所繪製方格的類別。The DataGridTableStyle is a class that represents the drawn grid only. 這個方格不應該與 @no__t 0 類別混淆,這是方格資料的可能來源。This grid should not be confused with the DataTable class, which is a possible source of data for the grid. 相反地,DataGridTableStyle 會嚴格表示在控制項中繪製的方格。Instead, the DataGridTableStyle strictly represents the grid as it is painted in the control. 因此,透過 DataGridTableStyle,您可以控制每個 DataTable 的方格外觀。Therefore, through the DataGridTableStyle you can control the appearance of the grid for each DataTable. 若要指定從特定 DataTable 顯示資料時使用的 DataGridTableStyle,請將 MappingName 設定為 DataTableTableNameTo specify which DataGridTableStyle is used when displaying data from a particular DataTable, set the MappingName to the TableName of a DataTable.

透過 TableStyles 屬性抓取的 @no__t 0 會包含 @no__t 3 控制項所使用的所有 DataGridTableStyle 物件。The GridTableStylesCollection retrieved through the TableStyles property contains all the DataGridTableStyle objects used by a System.Windows.Forms.DataGrid control. 集合可以包含您所需的 @no__t 0 個物件,但是每個的 MappingName 必須是唯一的。The collection can contain as many DataGridTableStyle objects as you need, however the MappingName of each must be unique. 在執行時間,這可讓您根據使用者的喜好設定,以不同的 DataGridTableStyle 取代相同的資料。At run time, this allows you to substitute a different DataGridTableStyle for the same data, depending on the user's preference. 若要這樣做:To do this:

  1. 使用 DataGridTableStyle 物件填入 GridTableStylesCollectionPopulate the GridTableStylesCollection with DataGridTableStyle objects. 如果 DataGridTableStyle 存在於 GridTableStylesCollection 中,而其 MappingName 屬性值等於 DataTable 物件的 TableName 屬性,則會顯示 DataTable,此 DataGridTableStyleIf a DataGridTableStyle exists in the GridTableStylesCollection whose MappingName property value equals the DataTable object's TableName property, the DataTable is displayed with this DataGridTableStyle. 如果沒有符合 MappingNameDataGridTableStyle,則會以資料方格資料表的預設樣式來顯示 DataTableIf no DataGridTableStyle exists with a matching MappingName, the DataTable is displayed with the default style for data grid tables.

  2. 當需要不同的格線樣式時,請使用 Item 屬性來選取適當的 DataGridTableStyle (將 TableName 傳遞至 Item[String] 屬性),並將傳回之物件的 MappingName 設定為新的值。When a different grid style is needed, use the Item property to select the appropriate DataGridTableStyle (pass the TableName to the Item[String] property) and set the MappingName of the returned object to a new value.

  3. 使用 [Item[String]] 屬性來選取所需的 DataGridTableStyle,並將其 MappingName 設定為 DataTableTableNameUse the Item[String] property to select the desired DataGridTableStyle, and set its MappingName to the TableName of the DataTable.

警告

請一律建立 DataGridColumnStyle 物件,並將其新增至 GridColumnStylesCollection,然後再將 DataGridTableStyle 物件新增至 GridTableStylesCollectionAlways create DataGridColumnStyle objects and add them to the GridColumnStylesCollection before adding DataGridTableStyle objects to the GridTableStylesCollection. 當您將具有有效 MappingName 值的空 DataGridTableStyle 新增至集合時,系統會自動為您產生 DataGridColumnStyle 物件。When you add an empty DataGridTableStyle with a valid MappingName value to the collection, DataGridColumnStyle objects are automatically generated for you. 因此,如果您嘗試將具有重複 MappingName 值的新 @no__t 0 物件新增至 GridColumnStylesCollection,則會擲回例外狀況。Consequently, an exception will be thrown if you try to add new DataGridColumnStyle objects with duplicate MappingName values to the GridColumnStylesCollection.

若要判斷目前顯示的 DataGridTableStyle,請使用 System.Windows.Forms.DataGridDataSource 和 @no__t 2 屬性傳回 CurrencyManagerTo determine which DataGridTableStyle is currently displayed, use the DataSource and DataMember properties of the System.Windows.Forms.DataGrid to return a CurrencyManager. 如果資料來源會執行 @no__t 0 介面,您可以使用 GetListName 方法傳回目前資料表的 MappingNameIf the data source implements the ITypedList interface, you can use the GetListName method to return the MappingName of the current table. 這會顯示在下列C#程式碼中:This is shown in the C# code below:

private void PrintCurrentListName(DataGrid myDataGrid){  
 CurrencyManager myCM = (CurrencyManager)  
 BindingContext[myDataGrid.DataSource, myDataGrid.DataMember];  
 IList myList = myCM.List;  
 ITypedList thisList = (ITypedList) myList;  
 Console.WriteLine(thisList.GetListName(null));  
}  

如果 DataSet 包含透過 DataRelation 物件相關的 DataTable 物件,而且目前顯示的 DataTable 是子資料工作表,則 @no__t 4 會傳回 RelationName 格式的字串(在最簡單的情況下)。If the DataSet contains DataTable objects related through DataRelation objects, and the currently displayed DataTable is a child table, the DataMember will return a string in the form of TableName.RelationName (in the simplest case). 如果 DataTable 在階層中的正下方,則字串會包含父資料表的名稱,後面接著需要用來到達資料表層級的必要 RelationName 值。If the DataTable is further down in the hierarchy, the string will consist of the parent table's name followed by the necessary RelationName values required to reach the table's level. 例如,在名為(從上到下)的階層式關聯性中,假設有三個 @no__t 0 的物件 RegionsCustomersOrders,以及兩個名為 RegionsToCustomersCustomersToOrders 的 @no__t 4 物件,則 DataMember 屬性會傳回 "區域. RegionsToCustomers. CustomersToOrders "。For example, imagine three DataTable objects in a hierarchical relationship named (top to bottom) Regions, Customers, and Orders, and two DataRelation objects named RegionsToCustomers and CustomersToOrders, the DataMember property will return "Regions.RegionsToCustomers.CustomersToOrders". 不過,MappingName 則會是「訂單」。However, the MappingName will then be "Orders".

@No__t-0 物件的集合會透過 System.Windows.Forms.DataGridTableStyles 屬性來傳回。The collection of DataGridTableStyle objects is returned through the TableStyles property of the System.Windows.Forms.DataGrid.

顯示 DataGridTableStyle 時,DataGridTableStyle 的設定將會覆寫 @no__t 2 控制項的設定。When a DataGridTableStyle is displayed, the settings for the DataGridTableStyle will override the settings for the System.Windows.Forms.DataGrid control. 如果未針對特定的 DataGridTableStyle 屬性設定值,則會改用 @no__t 1 控制項的值。If a value is not set for a particular DataGridTableStyle property, the System.Windows.Forms.DataGrid control's value will be used instead. 下列清單顯示可設定來覆寫 System.Windows.Forms.DataGrid 控制項屬性的 DataGridColumnStyle 屬性:The following list shows the DataGridColumnStyle properties that can be set to override System.Windows.Forms.DataGrid control properties:

若要將 DataGrid 系結至物件的強型別陣列,物件類型必須包含公用屬性。To bind the DataGrid to a strongly typed array of objects, the object type must contain public properties. 若要建立顯示陣列的 DataGridTableStyle,請將 DataGridTableStyle.MappingName 屬性設定為 typename,其中 typename 會由物件類型的名稱取代。To create a DataGridTableStyle that displays the array, set the DataGridTableStyle.MappingName property to typename where typename is replaced by the name of the object type. 另請注意,MappingName 屬性會區分大小寫;類型名稱必須完全相符。Also note that the MappingName property is case-sensitive; the type name must be matched exactly. 如需範例,請參閱 MappingName 屬性。See the MappingName property for an example.

您也可以將 DataGrid 系結至 ArrayListYou can also bind the DataGrid to an ArrayList. @No__t-0 的一項功能是它可以包含多個類型的物件,但當清單中的所有專案都是與第一個專案相同的類型時,DataGrid 只能系結到這類清單。A feature of the ArrayList is that it can contain objects of multiple types, but the DataGrid can only bind to such a list when all items in the list are of the same type as the first item. 這表示所有物件都必須是相同的類型,或必須繼承自與清單中第一個專案相同的類別。This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. 例如,如果清單中的第一個專案是 Control,則第二個專案可能是 TextBox (繼承自 Control)。For example, if the first item in a list is a Control, the second item could be a TextBox (which inherits from Control). 另一方面,如果第一個專案是 TextBox,則第二個物件不可以是 ControlIf, on the other hand, the first item is a TextBox, the second object cannot be a Control. 此外,ArrayList 在系結時必須有專案,而 DataGridTableStyle 中的物件必須包含公用屬性。Further, the ArrayList must have items in it when it is bound and the objects in the DataGridTableStyle must contain public properties. 空的 ArrayList 會導致空的方格。An empty ArrayList will result in an empty grid. 當系結至 ArrayList 時,將 DataGridTableStyleMappingName 設定為 "ArrayList" (型別名稱)。When binding to an ArrayList, set the MappingName of the DataGridTableStyle to "ArrayList" (the type name).

建構函式

DataGridTableStyle()

初始化 DataGridTableStyle 類別的新執行個體。Initializes a new instance of the DataGridTableStyle class.

DataGridTableStyle(Boolean)

使用指定值初始化 DataGridTableStyle 類別的新執行個體,以判斷方格資料表是否為預設樣式。Initializes a new instance of the DataGridTableStyle class using the specified value to determine whether the grid table is the default style.

DataGridTableStyle(CurrencyManager)

使用指定的 DataGridTableStyle 初始化 CurrencyManager 類別的新執行個體。Initializes a new instance of the DataGridTableStyle class with the specified CurrencyManager.

欄位

DefaultTableStyle

取得預設的資料表樣式。Gets the default table style.

屬性

AllowSorting

表示當使用這個 DataGridTableStyle 時,是否允許在方格資料表上進行排序。Indicates whether sorting is allowed on the grid table when this DataGridTableStyle is used.

AlternatingBackColor

取得或設定方格奇數資料列的背景色彩。Gets or sets the background color of odd-numbered rows of the grid.

BackColor

取得或設定方格其偶數資料列的背景色彩。Gets or sets the background color of even-numbered rows of the grid.

CanRaiseEvents

取得值,指出元件是否能引發事件。Gets a value indicating whether the component can raise an event.

(繼承來源 Component)
ColumnHeadersVisible

取得或設定值,表示資料行行首是否為可見。Gets or sets a value indicating whether column headers are visible.

Container

取得包含 IContainerComponentGets the IContainer that contains the Component.

(繼承來源 Component)
DataGrid

取得或設定繪製資料表的 DataGrid 控制項。Gets or sets the DataGrid control for the drawn table.

DesignMode

取得值,指出 Component 目前是否處於設計模式。Gets a value that indicates whether the Component is currently in design mode.

(繼承來源 Component)
Events

取得附加在這個 Component 上的事件處理常式清單。Gets the list of event handlers that are attached to this Component.

(繼承來源 Component)
ForeColor

取得或設定方格資列表的前景色彩。Gets or sets the foreground color of the grid table.

GridColumnStyles

取得為這個資料表所繪製的資料行集合。Gets the collection of columns drawn for this table.

GridLineColor

取得或設定格線色彩。Gets or sets the color of grid lines.

GridLineStyle

取得或設定格線樣式。Gets or sets the style of grid lines.

HeaderBackColor

取得或設定標頭的背景色彩。Gets or sets the background color of headers.

HeaderFont

取得或設定標頭標題所使用的字型。Gets or sets the font used for header captions.

HeaderForeColor

取得或設定標頭的前景色彩。Gets or sets the foreground color of headers.

LinkColor

取得或設定連結文字色彩。Gets or sets the color of link text.

LinkHoverColor

取得或設定停留在連結文字上時所顯示的色彩。Gets or sets the color displayed when hovering over link text.

MappingName

取得或設定用來將這個資料表對應至指定資料來源的名稱。Gets or sets the name used to map this table to a specific data source.

PreferredColumnWidth

取得或設定當顯示新方格時,用來建立資料行的寬度。Gets or sets the width used to create columns when a new grid is displayed.

PreferredRowHeight

取得或設定當顯示新方格時,用來建立資料列的高度。Gets or sets the height used to create a row when a new grid is displayed.

ReadOnly

取得或設定值,表示是否可編輯資料行。Gets or sets a value indicating whether columns can be edited.

RowHeadersVisible

取得或設定值,表示資料列標頭是否為可見。Gets or sets a value indicating whether row headers are visible.

RowHeaderWidth

取得或設定資料列標頭的寬度。Gets or sets the width of row headers.

SelectionBackColor

取得或設定選取儲存格的背景色彩。Gets or sets the background color of selected cells.

SelectionForeColor

取得或設定選取儲存格的前景色彩。Gets or sets the foreground color of selected cells.

Site

取得或設定 ComponentISiteGets or sets the ISite of the Component.

(繼承來源 Component)

方法

BeginEdit(DataGridColumnStyle, Int32)

要求編輯作業。Requests an edit operation.

CreateGridColumn(PropertyDescriptor)

使用指定的屬性描述項,建立 DataGridColumnStyleCreates a DataGridColumnStyle, using the specified property descriptor.

CreateGridColumn(PropertyDescriptor, Boolean)

使用指定的屬性描述項,建立 DataGridColumnStyleCreates a DataGridColumnStyle using the specified property descriptor. 指定 DataGridColumnStyle 是否為預設的資料行樣式。Specifies whether the DataGridColumnStyle is a default column style.

CreateObjRef(Type)

建立包含所有相關資訊的物件,這些資訊是產生用來與遠端物件通訊的所需 Proxy。Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.

(繼承來源 MarshalByRefObject)
Dispose()

釋放 Component 所使用的所有資源。Releases all resources used by the Component.

(繼承來源 Component)
Dispose(Boolean)

處置 (Dispose) DataGridTableStyle 所使用的資源 (除了記憶體之外)。Disposes of the resources (other than memory) used by the DataGridTableStyle.

EndEdit(DataGridColumnStyle, Int32, Boolean)

要求結束編輯作業。Requests an end to an edit operation.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetLifetimeService()

擷取控制這個執行個體存留期 (Lifetime) 原則的目前存留期服務物件。Retrieves the current lifetime service object that controls the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
GetService(Type)

傳回表示 Component 或其 Container 所提供之服務的物件。Returns an object that represents a service provided by the Component or by its Container.

(繼承來源 Component)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
InitializeLifetimeService()

取得存留期服務物件,以控制這個執行個體的存留期原則。Obtains a lifetime service object to control the lifetime policy for this instance.

(繼承來源 MarshalByRefObject)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
MemberwiseClone(Boolean)

建立目前 MarshalByRefObject 物件的淺層複本。Creates a shallow copy of the current MarshalByRefObject object.

(繼承來源 MarshalByRefObject)
OnAllowSortingChanged(EventArgs)

引發 AllowSortingChanged 事件。Raises the AllowSortingChanged event.

OnAlternatingBackColorChanged(EventArgs)

引發 AlternatingBackColorChanged 事件。Raises the AlternatingBackColorChanged event.

OnBackColorChanged(EventArgs)

引發 BackColorChanged 事件。Raises the BackColorChanged event.

OnColumnHeadersVisibleChanged(EventArgs)

引發 ColumnHeadersVisibleChanged 事件。Raises the ColumnHeadersVisibleChanged event.

OnForeColorChanged(EventArgs)

引發 ForeColorChanged 事件。Raises the ForeColorChanged event.

OnGridLineColorChanged(EventArgs)

引發 GridLineColorChanged 事件。Raises the GridLineColorChanged event.

OnGridLineStyleChanged(EventArgs)

引發 GridLineStyleChanged 事件。Raises the GridLineStyleChanged event.

OnHeaderBackColorChanged(EventArgs)

引發 HeaderBackColorChanged 事件。Raises the HeaderBackColorChanged event.

OnHeaderFontChanged(EventArgs)

引發 HeaderFontChanged 事件。Raises the HeaderFontChanged event.

OnHeaderForeColorChanged(EventArgs)

引發 HeaderForeColorChanged 事件。Raises the HeaderForeColorChanged event.

OnLinkColorChanged(EventArgs)

引發 LinkColorChanged 事件。Raises the LinkColorChanged event.

OnLinkHoverColorChanged(EventArgs)

引發 LinkHoverColorChanged 事件。Raises the LinkHoverColorChanged event.

OnMappingNameChanged(EventArgs)

引發 MappingNameChanged 事件。Raises the MappingNameChanged event.

OnPreferredColumnWidthChanged(EventArgs)

引發 PreferredColumnWidthChanged 事件。Raises the PreferredColumnWidthChanged event.

OnPreferredRowHeightChanged(EventArgs)

引發 PreferredRowHeightChanged 事件。Raises the PreferredRowHeightChanged event.

OnReadOnlyChanged(EventArgs)

引發 ReadOnlyChanged 事件。Raises the ReadOnlyChanged event.

OnRowHeadersVisibleChanged(EventArgs)

引發 RowHeadersVisibleChanged 事件。Raises the RowHeadersVisibleChanged event.

OnRowHeaderWidthChanged(EventArgs)

引發 RowHeaderWidthChanged 事件。Raises the RowHeaderWidthChanged event.

OnSelectionBackColorChanged(EventArgs)

引發 SelectionBackColorChanged 事件。Raises the SelectionBackColorChanged event.

OnSelectionForeColorChanged(EventArgs)

引發 SelectionForeColorChanged 事件。Raises the SelectionForeColorChanged event.

ResetAlternatingBackColor()

重設 AlternatingBackColor 屬性為其預設值。Resets the AlternatingBackColor property to its default value.

ResetBackColor()

重設 BackColor 屬性為其預設值。Resets the BackColor property to its default value.

ResetForeColor()

重設 ForeColor 屬性為其預設值。Resets the ForeColor property to its default value.

ResetGridLineColor()

重設 GridLineColor 屬性為其預設值。Resets the GridLineColor property to its default value.

ResetHeaderBackColor()

重設 HeaderBackColor 屬性為其預設值。Resets the HeaderBackColor property to its default value.

ResetHeaderFont()

重設 HeaderFont 屬性為其預設值。Resets the HeaderFont property to its default value.

ResetHeaderForeColor()

重設 HeaderForeColor 屬性為其預設值。Resets the HeaderForeColor property to its default value.

ResetLinkColor()

重設 LinkColor 屬性為其預設值。Resets the LinkColor property to its default value.

ResetLinkHoverColor()

重設 LinkHoverColor 屬性為其預設值。Resets the LinkHoverColor property to its default value.

ResetSelectionBackColor()

重設 SelectionBackColor 屬性為其預設值。Resets the SelectionBackColor property to its default value.

ResetSelectionForeColor()

重設 SelectionForeColor 屬性為其預設值。Resets the SelectionForeColor property to its default value.

ShouldSerializeAlternatingBackColor()

指示是否應該保存 AlternatingBackColor 屬性。Indicates whether the AlternatingBackColor property should be persisted.

ShouldSerializeBackColor()

指示是否應該保存 BackColor 屬性。Indicates whether the BackColor property should be persisted.

ShouldSerializeForeColor()

指示是否應該保存 ForeColor 屬性。Indicates whether the ForeColor property should be persisted.

ShouldSerializeGridLineColor()

指示是否應該保存 GridLineColor 屬性。Indicates whether the GridLineColor property should be persisted.

ShouldSerializeHeaderBackColor()

指示是否應該保存 HeaderBackColor 屬性。Indicates whether the HeaderBackColor property should be persisted.

ShouldSerializeHeaderForeColor()

指示是否應該保存 HeaderForeColor 屬性。Indicates whether the HeaderForeColor property should be persisted.

ShouldSerializeLinkColor()

指示是否應該保存 LinkColor 屬性。Indicates whether the LinkColor property should be persisted.

ShouldSerializeLinkHoverColor()

指示是否應該保存 LinkHoverColor 屬性。Indicates whether the LinkHoverColor property should be persisted.

ShouldSerializePreferredRowHeight()

指示是否應該保存 PreferredRowHeight 屬性。Indicates whether the PreferredRowHeight property should be persisted.

ShouldSerializeSelectionBackColor()

指示是否應該保存 SelectionBackColor 屬性。Indicates whether the SelectionBackColor property should be persisted.

ShouldSerializeSelectionForeColor()

指示是否應該保存 SelectionForeColor 屬性。Indicates whether the SelectionForeColor property should be persisted.

ToString()

傳回任何包含 Component 名稱的 StringReturns a String containing the name of the Component, if any. 不應覆寫此方法。This method should not be overridden.

(繼承來源 Component)

事件

AllowSortingChanged

發生在 AllowSorting 屬性值變更時。Occurs when the AllowSorting property value changes.

AlternatingBackColorChanged

發生於 AlternatingBackColor 值變更時。Occurs when the AlternatingBackColor value changes.

BackColorChanged

發生於 BackColor 值變更時。Occurs when the BackColor value changes.

ColumnHeadersVisibleChanged

發生於 ColumnHeadersVisible 值變更時。Occurs when the ColumnHeadersVisible value changes.

Disposed

當此元件由 Dispose() 方法的呼叫處置時發生。Occurs when the component is disposed by a call to the Dispose() method.

(繼承來源 Component)
ForeColorChanged

發生於 ForeColor 值變更時。Occurs when the ForeColor value changes.

GridLineColorChanged

發生於 GridLineColor 值變更時。Occurs when the GridLineColor value changes.

GridLineStyleChanged

發生於 GridLineStyle 值變更時。Occurs when the GridLineStyle value changes.

HeaderBackColorChanged

發生於 HeaderBackColor 值變更時。Occurs when the HeaderBackColor value changes.

HeaderFontChanged

發生於 HeaderFont 值變更時。Occurs when the HeaderFont value changes.

HeaderForeColorChanged

發生於 HeaderForeColor 值變更時。Occurs when the HeaderForeColor value changes.

LinkColorChanged

發生於 LinkColor 值變更時。Occurs when the LinkColor value changes.

LinkHoverColorChanged

發生於 LinkHoverColor 值變更時。Occurs when the LinkHoverColor value changes.

MappingNameChanged

發生於 MappingName 值變更時。Occurs when the MappingName value changes.

PreferredColumnWidthChanged

發生在 PreferredColumnWidth 屬性值變更時。Occurs when the PreferredColumnWidth property value changes.

PreferredRowHeightChanged

發生於 PreferredRowHeight 值變更時。Occurs when the PreferredRowHeight value changes.

ReadOnlyChanged

發生於 ReadOnly 值變更時。Occurs when the ReadOnly value changes.

RowHeadersVisibleChanged

發生於 RowHeadersVisible 值變更時。Occurs when the RowHeadersVisible value changes.

RowHeaderWidthChanged

發生於 RowHeaderWidth 值變更時。Occurs when the RowHeaderWidth value changes.

SelectionBackColorChanged

發生於 SelectionBackColor 值變更時。Occurs when the SelectionBackColor value changes.

SelectionForeColorChanged

發生於 SelectionForeColor 值變更時。Occurs when the SelectionForeColor value changes.

適用於

另請參閱