我有一個自定義DataGrid
與DataGridTemplateColumns
混合在一起並且從此答案導出了一個自定義行爲Silverlight Datagrid: Highlight an entire column when that column is sorted。我遇到的問題是任何DataGridTemplateColumn的單元格都沒有選擇「高亮」。用於自定義列的單元格模板的結構如下所示。任何人有任何想法爲什麼背景突出顯示沒有被應用?一段時間以來,我一直在對這個問題大發雷霆。Silverlight Datagrid:使用自定義行爲設置模板單元格的背景
<DataTemplate>
<Grid>
<Border VerticalAlignment='Stretch' Margin='1' Background='Transparent'>
<TextBlock VerticalAlignment='Center' Text='{Binding Path=Variable}' />
</Border>
</Grid>
</DataTemplate>