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
实现

示例

下面的代码示例创建两个 DataGridTableStyle 实例,并将每个对象的 @no__t 设置为 @no__t 中 @no__t 3 的 @no__t。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 对象添加到每个 DataGridTableStyle 的 @no__t 中。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

注解

@No__t-0 控件以网格的形式显示数据。The System.Windows.Forms.DataGrid control displays data in the form of a grid. @No__t 为仅表示所绘制的网格的类。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 可以控制每个 @no__t 的网格的外观。Therefore, through the DataGridTableStyle you can control the appearance of the grid for each DataTable. 若要指定显示特定 @no__t 中的数据时使用的 @no__t 0,请将 @no__t 2 设置 @no__t 为 @no__t 的第3步。To specify which DataGridTableStyle is used when displaying data from a particular DataTable, set the MappingName to the TableName of a DataTable.

通过 @no__t 属性检索 GridTableStylesCollection 包含 @no__t 的控件使用的所有 @no__t 2 对象。The GridTableStylesCollection retrieved through the TableStyles property contains all the DataGridTableStyle objects used by a System.Windows.Forms.DataGrid control. 集合可以包含所需数量的 @no__t 0 对象,但每个对象的 @no__t 必须唯一。The collection can contain as many DataGridTableStyle objects as you need, however the MappingName of each must be unique. 在运行时,这允许你根据用户的偏好,将不同的 @no__t 替换为同一数据。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. 用 @no__t 对象填充 GridTableStylesCollectionPopulate the GridTableStylesCollection with DataGridTableStyle objects. 如果 GridTableStylesCollection 中存在 ,其 MappingName 属性值等于 @no__t 3 对象的 @no__t 属性,则会显示 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 不存在具有匹配的 MappingName,则将使用数据网格表的默认样式显示 @no__t。If no DataGridTableStyle exists with a matching MappingName, the DataTable is displayed with the default style for data grid tables.

  2. 如果需要不同的网格样式,请使用 Item 属性来选择相应的 DataGridTableStyle (将 @no__t 传递到 Item[String] 属性),并将返回的对象的第 4 @no__t 设置为一个新值。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,并将其 @no__t 设置 @no__t 为 @no__t 的第3步。Use the Item[String] property to select the desired DataGridTableStyle, and set its MappingName to the TableName of the DataTable.

注意

在将 DataGridTableStyle 对象添加到 @no__t 3 之前,始终创建 @no__t 0 个对象并将其添加到 @no__t 1。Always create DataGridColumnStyle objects and add them to the GridColumnStylesCollection before adding DataGridTableStyle objects to the GridTableStylesCollection. 向集合添加具有有效的 MappingName 值的空 DataGridTableStyle 时,将自动为你生成 @no__t 2 个对象。When you add an empty DataGridTableStyle with a valid MappingName value to the collection, DataGridColumnStyle objects are automatically generated for you. 因此,如果尝试将具有重复的 @no__t 1 值的新 @no__t 对象添加到 GridColumnStylesCollection,将引发异常。Consequently, an exception will be thrown if you try to add new DataGridColumnStyle objects with duplicate MappingName values to the GridColumnStylesCollection.

若要确定当前显示的 @no__t 0,请使用 @no__t 的 DataSource 和 @no__t 2 属性返回 @no__t。To determine which DataGridTableStyle is currently displayed, use the DataSource and DataMember properties of the System.Windows.Forms.DataGrid to return a CurrencyManager. 如果数据源实现 ITypedList 接口,则可以使用 GetListName 方法返回当前表的 @no__t 2。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));  
}  

如果 DataSet 包含通过 DataRelation 对象相关的 @no__t 1 对象,并且当前显示的 @no__t 为子表,则 DataMember 将返回 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,则该字符串将包含父表的名称,后跟到达表级别所需的必要 @no__t 1 值。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,以及两个名为 RegionsToCustomers 和 @no__t 的 2-4 个对象,则 @no__t 属性将返回 "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". 但 @no__t 为 "Orders"。However, the MappingName will then be "Orders".

@No__t-0 对象的集合通过 @no__t 的 @no__t 属性返回。The collection of DataGridTableStyle objects is returned through the TableStyles property of the System.Windows.Forms.DataGrid.

当显示 DataGridTableStyle 时,@no__t 的设置将覆盖 @no__t 控件的设置。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. 以下列表显示了可设置为替代 @no__t 控件属性的 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. 若要创建显示数组的 @no__t 0,请将 @no__t 属性设置为 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 绑定到 @no__t。You can also bind the DataGrid to an ArrayList. @No__t 的一项功能是它可以包含多种类型的对象,但如果列表中的所有项的类型与第一个项的类型相同,则 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 (从 @no__t 继承)。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 时,请将 DataGridTableStyle 的 @no__t 设置为 "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

获取 IContainer,它包含 ComponentGets 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)

创建一个对象,该对象包含生成用于与远程对象进行通信的代理所需的全部相关信息。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)

处置由 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()

检索控制此实例的生存期策略的当前生存期服务对象。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 的浅表副本。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 的名称的 String(如果有)。Returns 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.

适用于

另请参阅