DataGridViewCell.InheritedStyle DataGridViewCell.InheritedStyle DataGridViewCell.InheritedStyle DataGridViewCell.InheritedStyle Property


获取当前应用于单元格的样式。Gets the style currently applied to the cell.

 property System::Windows::Forms::DataGridViewCellStyle ^ InheritedStyle { System::Windows::Forms::DataGridViewCellStyle ^ get(); };
public System.Windows.Forms.DataGridViewCellStyle InheritedStyle { get; }
member this.InheritedStyle : System.Windows.Forms.DataGridViewCellStyle
Public ReadOnly Property InheritedStyle As DataGridViewCellStyle



该单元格不属于 DataGridView 控件。The cell does not belong to a DataGridView control.

- 或 --or- ColumnIndex 小于 0,这表示该单元格为行标头单元格。ColumnIndex is less than 0, indicating that the cell is a row header cell.

包含该单元格的行是共享行。The row containing the cell is a shared row.

- 或 --or- 该单元格是列标题单元格。The cell is a column header cell.


DataGridView控件显示其使用指示单元格的样式的单元格InheritedStyle属性,它继承自其他类型的属性的样式DataGridViewCellStyleThe DataGridView control displays its cells using the styles indicated by the cell InheritedStyle property, which inherits styles from other properties of type DataGridViewCellStyle. 通过指定的样式Style属性重写所有其他单元格样式属性,通过指定的样式,但不是一定表示参与到单元格的外观的所有样式。The styles specified through the Style property override the styles specified through all other cell-style properties, but do not necessarily indicate all the styles that contribute to the cell's appearance.

有关详细信息,请参阅Windows 窗体 DataGridView 控件中的单元格样式For more information, see Cell Styles in the Windows Forms DataGridView Control.