DataGridTableStyle DataGridTableStyle DataGridTableStyle DataGridTableStyle Class

定義

表示 DataGrid 控制項在 Run Time 中繪製的資料表。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兩個實例, MappingName並將每個DataTable物件TableName的設定為中DataSet之的。The following code example creates two DataGridTableStyle instances and sets the MappingName of each object to the TableName of a DataTable in a DataSet. 然後, 此範例DataGridColumnStyle會將物件GridColumnStylesCollection加入至DataGridTableStyle每個的。The 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 'AddCustomDataTableStyle

備註

System.Windows.Forms.DataGrid控制項會以方格的形式來顯示資料。The System.Windows.Forms.DataGrid control displays data in the form of a grid. DataGridTableStyle是代表所繪製方格的類別。The DataGridTableStyle is a class that represents the drawn grid only. 這個方格不應該與DataTable類別混淆, 這是方格資料的可能來源。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. 若要指定DataGridTableStyle在顯示特定DataTable資料時使用哪一個TableName , 請將MappingName設定為的。 DataTableTo specify which DataGridTableStyle is used when displaying data from a particular DataTable, set the MappingName to the TableName of a DataTable.

透過屬性抓取的GridTableStylesCollection會包含System.Windows.Forms.DataGrid控制項所DataGridTableStyle使用的所有物件。 TableStylesThe GridTableStylesCollection retrieved through the TableStyles property contains all the DataGridTableStyle objects used by a System.Windows.Forms.DataGrid control. 集合可以包含您所需DataGridTableStyle數量的物件, 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. GridTableStylesCollectionDataGridTableStyle填入物件。Populate the GridTableStylesCollection with DataGridTableStyle objects. GridTableStylesCollection DataGridTableStyle如果存在於其MappingName屬性值等於物件TableName屬性的中,就會顯示此。DataTable 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. 如果沒有DataGridTableStyle DataTable符合的MappingName, 則會顯示資料方格資料表的預設樣式。If no DataGridTableStyle exists with a matching MappingName, the DataTable is displayed with the default style for data grid tables.

  2. 當需要不同的格線樣式時, 請Item使用屬性來選取適當DataGridTableStyleItem[String] (將TableName傳遞至屬性), 並將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. MappingName DataTable TableName使用屬性來選取所需DataGridTableStyle的, 並將其設定為的。 Item[String]Use 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. 當您將具有有效值DataGridTableStyle MappingName的空白新增至集合時, DataGridColumnStyle系統會自動為您產生物件。When you add an empty DataGridTableStyle with a valid MappingName value to the collection, DataGridColumnStyle objects are automatically generated for you. 因此, 如果您嘗試將具有重複DataGridColumnStyle MappingName值的新物件加入至GridColumnStylesCollection, 則會擲回例外狀況。Consequently, an exception will be thrown if you try to add new DataGridColumnStyle objects with duplicate MappingName values to the GridColumnStylesCollection.

若要判斷DataGridTableStyle目前顯示的是哪一個DataSource CurrencyManager, DataMember請使用的System.Windows.Forms.DataGrid和屬性來傳回。To determine which DataGridTableStyle is currently displayed, use the DataSource and DataMember properties of the System.Windows.Forms.DataGrid to return a CurrencyManager. 如果資料來源ITypedListGetListName執行介面, 您可以使用方法來MappingName傳回目前資料表的。If 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));  
}  

DataMember DataTable如果包含透過DataTable 物件DataRelation相關的物件, 且目前顯示的是子資料工作表, 則會傳回 RelationName 格式的字串 (在最簡單的情況下)。 DataSetIf 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). 如果階層中的RelationName 正下方,則字串會包含父資料表的名稱,後面接著需要用來到達資料表層級的必要值。DataTableIf 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. 例如, 假設有三DataTable個物件在階層式關聯性中, 名為 ( Customers從上Orders到下) DataRelation Regions、和RegionsToCustomers , CustomersToOrders以及兩個名為和的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".

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

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

若要將系結至物件的強型別陣列,物件類型必須包含公用屬性。DataGridTo 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. 如需範例, 請參閱屬性。MappingNameSee the MappingName property for an example.

您也DataGrid可以將系結ArrayList至。You can also bind the DataGrid to an ArrayList. 的功能ArrayList是它可以包含多個類型的物件, 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, 第二個物件就不能Control是。If, 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時, MappingName將的設DataGridTableStyle為 "ArrayList" (型別名稱)。When binding to an ArrayList, set the MappingName of the DataGridTableStyle to "ArrayList" (the type name).

建構函式

DataGridTableStyle() DataGridTableStyle() DataGridTableStyle() DataGridTableStyle()

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

DataGridTableStyle(Boolean) DataGridTableStyle(Boolean) DataGridTableStyle(Boolean) 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) DataGridTableStyle(CurrencyManager) DataGridTableStyle(CurrencyManager)

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

欄位

DefaultTableStyle DefaultTableStyle DefaultTableStyle DefaultTableStyle

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

屬性

AllowSorting AllowSorting AllowSorting AllowSorting

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

AlternatingBackColor AlternatingBackColor AlternatingBackColor AlternatingBackColor

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

BackColor BackColor BackColor BackColor

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

CanRaiseEvents CanRaiseEvents CanRaiseEvents CanRaiseEvents

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

(Inherited from Component)
ColumnHeadersVisible ColumnHeadersVisible ColumnHeadersVisible ColumnHeadersVisible

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

Container Container Container Container

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

(Inherited from Component)
DataGrid DataGrid DataGrid DataGrid

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

DesignMode DesignMode DesignMode DesignMode

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

(Inherited from Component)
Events Events Events Events

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

(Inherited from Component)
ForeColor ForeColor ForeColor ForeColor

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

GridColumnStyles GridColumnStyles GridColumnStyles GridColumnStyles

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

GridLineColor GridLineColor GridLineColor GridLineColor

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

GridLineStyle GridLineStyle GridLineStyle GridLineStyle

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

HeaderBackColor HeaderBackColor HeaderBackColor HeaderBackColor

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

HeaderFont HeaderFont HeaderFont HeaderFont

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

HeaderForeColor HeaderForeColor HeaderForeColor HeaderForeColor

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

LinkColor LinkColor LinkColor LinkColor

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

LinkHoverColor LinkHoverColor LinkHoverColor LinkHoverColor

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

MappingName MappingName MappingName MappingName

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

PreferredColumnWidth PreferredColumnWidth PreferredColumnWidth PreferredColumnWidth

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

PreferredRowHeight PreferredRowHeight PreferredRowHeight PreferredRowHeight

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

ReadOnly ReadOnly ReadOnly ReadOnly

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

RowHeadersVisible RowHeadersVisible RowHeadersVisible RowHeadersVisible

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

RowHeaderWidth RowHeaderWidth RowHeaderWidth RowHeaderWidth

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

SelectionBackColor SelectionBackColor SelectionBackColor SelectionBackColor

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

SelectionForeColor SelectionForeColor SelectionForeColor SelectionForeColor

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

Site Site Site Site

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

(Inherited from Component)

方法

BeginEdit(DataGridColumnStyle, Int32) BeginEdit(DataGridColumnStyle, Int32) BeginEdit(DataGridColumnStyle, Int32) BeginEdit(DataGridColumnStyle, Int32)

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

CreateGridColumn(PropertyDescriptor) CreateGridColumn(PropertyDescriptor) CreateGridColumn(PropertyDescriptor) CreateGridColumn(PropertyDescriptor)

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

CreateGridColumn(PropertyDescriptor, Boolean) CreateGridColumn(PropertyDescriptor, Boolean) CreateGridColumn(PropertyDescriptor, Boolean) CreateGridColumn(PropertyDescriptor, Boolean)

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

CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type) CreateObjRef(Type)

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

(Inherited from MarshalByRefObject)
Dispose() Dispose() Dispose() Dispose()

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

(Inherited from Component)
Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

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

EndEdit(DataGridColumnStyle, Int32, Boolean) EndEdit(DataGridColumnStyle, Int32, Boolean) EndEdit(DataGridColumnStyle, Int32, Boolean) EndEdit(DataGridColumnStyle, Int32, Boolean)

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

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

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

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

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

(Inherited from Object)
GetLifetimeService() GetLifetimeService() GetLifetimeService() GetLifetimeService()

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

(Inherited from MarshalByRefObject)
GetService(Type) GetService(Type) GetService(Type) GetService(Type)

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

(Inherited from Component)
GetType() GetType() GetType() GetType()

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

(Inherited from Object)
InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService() InitializeLifetimeService()

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

(Inherited from MarshalByRefObject)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

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

(Inherited from Object)
MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean) MemberwiseClone(Boolean)

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

(Inherited from MarshalByRefObject)
OnAllowSortingChanged(EventArgs) OnAllowSortingChanged(EventArgs) OnAllowSortingChanged(EventArgs) OnAllowSortingChanged(EventArgs)

引發 AllowSortingChanged 事件。Raises the AllowSortingChanged event.

OnAlternatingBackColorChanged(EventArgs) OnAlternatingBackColorChanged(EventArgs) OnAlternatingBackColorChanged(EventArgs) OnAlternatingBackColorChanged(EventArgs)

引發 AlternatingBackColorChanged 事件。Raises the AlternatingBackColorChanged event.

OnBackColorChanged(EventArgs) OnBackColorChanged(EventArgs) OnBackColorChanged(EventArgs) OnBackColorChanged(EventArgs)

引發 BackColorChanged 事件。Raises the BackColorChanged event.

OnColumnHeadersVisibleChanged(EventArgs) OnColumnHeadersVisibleChanged(EventArgs) OnColumnHeadersVisibleChanged(EventArgs) OnColumnHeadersVisibleChanged(EventArgs)

引發 ColumnHeadersVisibleChanged 事件。Raises the ColumnHeadersVisibleChanged event.

OnForeColorChanged(EventArgs) OnForeColorChanged(EventArgs) OnForeColorChanged(EventArgs) OnForeColorChanged(EventArgs)

引發 ForeColorChanged 事件。Raises the ForeColorChanged event.

OnGridLineColorChanged(EventArgs) OnGridLineColorChanged(EventArgs) OnGridLineColorChanged(EventArgs) OnGridLineColorChanged(EventArgs)

引發 GridLineColorChanged 事件。Raises the GridLineColorChanged event.

OnGridLineStyleChanged(EventArgs) OnGridLineStyleChanged(EventArgs) OnGridLineStyleChanged(EventArgs) OnGridLineStyleChanged(EventArgs)

引發 GridLineStyleChanged 事件。Raises the GridLineStyleChanged event.

OnHeaderBackColorChanged(EventArgs) OnHeaderBackColorChanged(EventArgs) OnHeaderBackColorChanged(EventArgs) OnHeaderBackColorChanged(EventArgs)

引發 HeaderBackColorChanged 事件。Raises the HeaderBackColorChanged event.

OnHeaderFontChanged(EventArgs) OnHeaderFontChanged(EventArgs) OnHeaderFontChanged(EventArgs) OnHeaderFontChanged(EventArgs)

引發 HeaderFontChanged 事件。Raises the HeaderFontChanged event.

OnHeaderForeColorChanged(EventArgs) OnHeaderForeColorChanged(EventArgs) OnHeaderForeColorChanged(EventArgs) OnHeaderForeColorChanged(EventArgs)

引發 HeaderForeColorChanged 事件。Raises the HeaderForeColorChanged event.

OnLinkColorChanged(EventArgs) OnLinkColorChanged(EventArgs) OnLinkColorChanged(EventArgs) OnLinkColorChanged(EventArgs)

引發 LinkColorChanged 事件。Raises the LinkColorChanged event.

OnLinkHoverColorChanged(EventArgs) OnLinkHoverColorChanged(EventArgs) OnLinkHoverColorChanged(EventArgs) OnLinkHoverColorChanged(EventArgs)

引發 LinkHoverColorChanged 事件。Raises the LinkHoverColorChanged event.

OnMappingNameChanged(EventArgs) OnMappingNameChanged(EventArgs) OnMappingNameChanged(EventArgs) OnMappingNameChanged(EventArgs)

引發 MappingNameChanged 事件。Raises the MappingNameChanged event

OnPreferredColumnWidthChanged(EventArgs) OnPreferredColumnWidthChanged(EventArgs) OnPreferredColumnWidthChanged(EventArgs) OnPreferredColumnWidthChanged(EventArgs)

引發 PreferredColumnWidthChanged 事件。Raises the PreferredColumnWidthChanged event.

OnPreferredRowHeightChanged(EventArgs) OnPreferredRowHeightChanged(EventArgs) OnPreferredRowHeightChanged(EventArgs) OnPreferredRowHeightChanged(EventArgs)

引發 PreferredRowHeightChanged 事件。Raises the PreferredRowHeightChanged event.

OnReadOnlyChanged(EventArgs) OnReadOnlyChanged(EventArgs) OnReadOnlyChanged(EventArgs) OnReadOnlyChanged(EventArgs)

引發 ReadOnlyChanged 事件。Raises the ReadOnlyChanged event.

OnRowHeadersVisibleChanged(EventArgs) OnRowHeadersVisibleChanged(EventArgs) OnRowHeadersVisibleChanged(EventArgs) OnRowHeadersVisibleChanged(EventArgs)

引發 RowHeadersVisibleChanged 事件。Raises the RowHeadersVisibleChanged event.

OnRowHeaderWidthChanged(EventArgs) OnRowHeaderWidthChanged(EventArgs) OnRowHeaderWidthChanged(EventArgs) OnRowHeaderWidthChanged(EventArgs)

引發 RowHeaderWidthChanged 事件。Raises the RowHeaderWidthChanged event.

OnSelectionBackColorChanged(EventArgs) OnSelectionBackColorChanged(EventArgs) OnSelectionBackColorChanged(EventArgs) OnSelectionBackColorChanged(EventArgs)

引發 SelectionBackColorChanged 事件。Raises the SelectionBackColorChanged event.

OnSelectionForeColorChanged(EventArgs) OnSelectionForeColorChanged(EventArgs) OnSelectionForeColorChanged(EventArgs) OnSelectionForeColorChanged(EventArgs)

引發 SelectionForeColorChanged 事件。Raises the SelectionForeColorChanged event.

ResetAlternatingBackColor() ResetAlternatingBackColor() ResetAlternatingBackColor() ResetAlternatingBackColor()

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

ResetBackColor() ResetBackColor() ResetBackColor() ResetBackColor()

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

ResetForeColor() ResetForeColor() ResetForeColor() ResetForeColor()

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

ResetGridLineColor() ResetGridLineColor() ResetGridLineColor() ResetGridLineColor()

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

ResetHeaderBackColor() ResetHeaderBackColor() ResetHeaderBackColor() ResetHeaderBackColor()

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

ResetHeaderFont() ResetHeaderFont() ResetHeaderFont() ResetHeaderFont()

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

ResetHeaderForeColor() ResetHeaderForeColor() ResetHeaderForeColor() ResetHeaderForeColor()

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

ResetLinkColor() ResetLinkColor() ResetLinkColor() ResetLinkColor()

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

ResetLinkHoverColor() ResetLinkHoverColor() ResetLinkHoverColor() ResetLinkHoverColor()

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

ResetSelectionBackColor() ResetSelectionBackColor() ResetSelectionBackColor() ResetSelectionBackColor()

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

ResetSelectionForeColor() ResetSelectionForeColor() ResetSelectionForeColor() ResetSelectionForeColor()

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

ShouldSerializeAlternatingBackColor() ShouldSerializeAlternatingBackColor() ShouldSerializeAlternatingBackColor() ShouldSerializeAlternatingBackColor()

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

ShouldSerializeBackColor() ShouldSerializeBackColor() ShouldSerializeBackColor() ShouldSerializeBackColor()

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

ShouldSerializeForeColor() ShouldSerializeForeColor() ShouldSerializeForeColor() ShouldSerializeForeColor()

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

ShouldSerializeGridLineColor() ShouldSerializeGridLineColor() ShouldSerializeGridLineColor() ShouldSerializeGridLineColor()

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

ShouldSerializeHeaderBackColor() ShouldSerializeHeaderBackColor() ShouldSerializeHeaderBackColor() ShouldSerializeHeaderBackColor()

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

ShouldSerializeHeaderForeColor() ShouldSerializeHeaderForeColor() ShouldSerializeHeaderForeColor() ShouldSerializeHeaderForeColor()

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

ShouldSerializeLinkColor() ShouldSerializeLinkColor() ShouldSerializeLinkColor() ShouldSerializeLinkColor()

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

ShouldSerializeLinkHoverColor() ShouldSerializeLinkHoverColor() ShouldSerializeLinkHoverColor() ShouldSerializeLinkHoverColor()

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

ShouldSerializePreferredRowHeight() ShouldSerializePreferredRowHeight() ShouldSerializePreferredRowHeight() ShouldSerializePreferredRowHeight()

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

ShouldSerializeSelectionBackColor() ShouldSerializeSelectionBackColor() ShouldSerializeSelectionBackColor() ShouldSerializeSelectionBackColor()

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

ShouldSerializeSelectionForeColor() ShouldSerializeSelectionForeColor() ShouldSerializeSelectionForeColor() ShouldSerializeSelectionForeColor()

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

ToString() ToString() ToString() ToString()

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

(Inherited from Component)

事件

AllowSortingChanged AllowSortingChanged AllowSortingChanged AllowSortingChanged

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

AlternatingBackColorChanged AlternatingBackColorChanged AlternatingBackColorChanged AlternatingBackColorChanged

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

BackColorChanged BackColorChanged BackColorChanged BackColorChanged

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

ColumnHeadersVisibleChanged ColumnHeadersVisibleChanged ColumnHeadersVisibleChanged ColumnHeadersVisibleChanged

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

Disposed Disposed Disposed Disposed

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

(Inherited from Component)
ForeColorChanged ForeColorChanged ForeColorChanged ForeColorChanged

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

GridLineColorChanged GridLineColorChanged GridLineColorChanged GridLineColorChanged

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

GridLineStyleChanged GridLineStyleChanged GridLineStyleChanged GridLineStyleChanged

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

HeaderBackColorChanged HeaderBackColorChanged HeaderBackColorChanged HeaderBackColorChanged

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

HeaderFontChanged HeaderFontChanged HeaderFontChanged HeaderFontChanged

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

HeaderForeColorChanged HeaderForeColorChanged HeaderForeColorChanged HeaderForeColorChanged

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

LinkColorChanged LinkColorChanged LinkColorChanged LinkColorChanged

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

LinkHoverColorChanged LinkHoverColorChanged LinkHoverColorChanged LinkHoverColorChanged

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

MappingNameChanged MappingNameChanged MappingNameChanged MappingNameChanged

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

PreferredColumnWidthChanged PreferredColumnWidthChanged PreferredColumnWidthChanged PreferredColumnWidthChanged

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

PreferredRowHeightChanged PreferredRowHeightChanged PreferredRowHeightChanged PreferredRowHeightChanged

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

ReadOnlyChanged ReadOnlyChanged ReadOnlyChanged ReadOnlyChanged

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

RowHeadersVisibleChanged RowHeadersVisibleChanged RowHeadersVisibleChanged RowHeadersVisibleChanged

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

RowHeaderWidthChanged RowHeaderWidthChanged RowHeaderWidthChanged RowHeaderWidthChanged

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

SelectionBackColorChanged SelectionBackColorChanged SelectionBackColorChanged SelectionBackColorChanged

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

SelectionForeColorChanged SelectionForeColorChanged SelectionForeColorChanged SelectionForeColorChanged

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

適用於

另請參閱