DataGridColumn.CellStyle DataGridColumn.CellStyle DataGridColumn.CellStyle DataGridColumn.CellStyle Property


取得或設定用於呈現資料行中儲存格的樣式。Gets or sets the style that is used to render cells in the column.

 property System::Windows::Style ^ CellStyle { System::Windows::Style ^ get(); void set(System::Windows::Style ^ value); };
public System.Windows.Style CellStyle { get; set; }
member this.CellStyle : System.Windows.Style with get, set
Public Property CellStyle As Style


呈現資料行中的儲存格所使用的樣式。The style that is used to render cells in the column. 已註冊的預設值是 nullThe registered default is null. 如需哪些因素會影響值的詳細資訊,請參閱 DependencyPropertyFor information about what can influence the value, see DependencyProperty.


若要定義Style資料格的,請TargetType指定的DataGridCellTo define a Style for a cell, specify a TargetType of DataGridCell.

Style可以套用至資料表、資料行或資料格層級的資料格。A Style can be applied to a cell at the table, column, or cell level. 若要將Style套用至資料行中的所有資料格DataGridColumn.CellStyle ,請設定屬性, DataGrid.CellStyle其優先于屬性。To apply a Style to all cells in a column, set the DataGridColumn.CellStyle property, which takes precedence over the DataGrid.CellStyle property. 若要將Style套用至個別的DataGridCell資料格, Style請直接在物件上設定屬性,其優先順序高於您套用至儲存格的所有其他樣式。To apply a Style to an individual cell, set the Style property directly on the DataGridCell object, which takes precedence over all other styles that you apply to the cell.