DataGridColumn.CellStyle 屬性

定義

取得或設定用於呈現資料行中儲存格的樣式。

public:
 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

屬性值

Style

呈現資料行中的儲存格所使用的樣式。 已註冊的預設值是 null。 如需哪些因素會影響值的詳細資訊,請參閱 DependencyProperty

備註

若要定義 Style 儲存格的 ,請指定 TargetTypeDataGridCell

Style可以套用至資料表、資料行或儲存格層級的儲存格。 若要將 套用 Style 至資料行中的所有儲存格,請設定 DataGridColumn.CellStyle 屬性,其優先順序高於 DataGrid.CellStyle 屬性。 若要將 套用 Style 至個別儲存格,請直接在 物件上 DataGridCell 設定 Style 屬性,其優先順序高於您套用至儲存格的所有其他樣式。

適用於

另請參閱