1
我嘗試風格化DataGridTextColumn設置頁眉和單元格樣式separatly:WPF:如何在一個樣式類中設置DataGridTextColumn的樣式?
<Style x:Key="headerStyle">
<Setter Property="DataGridColumnHeader.Background" ... />
...
<Style x:Key="cellStyle">
<Setter Property="DataGridCell.Background" ... />
...
<DataGrid>
<DataGrid.Columns>
<DataGridTextColumn
HeaderStyle="{StaticResource ResourceKey='headerStyle'}"
CellStyle="{StaticResource ResourceKey='cellStyle'}" ... />
我可以程式化DataGridTextColumn頭,電池等特性於一體樣式聲明?
它提供了*應該*應用的ElementStyle屬性,但它不包含:-( – HiredMind 2011-09-14 15:42:32
@HiredMind:['ElementStyle'](http://msdn.microsoft.com/zh-cn/library/system。 windows.controls.datagridboundcolumn.elementstyle.aspx)如果對於單元格而不是列本身。 – 2011-09-14 18:38:23