问题
I'm trying to set the ItemsPanel of a DataGridCellsPresenter in the Resources of my Window.
<Style TargetType="{x:Type DataGridCellsPresenter}">
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<WPFVarTab:CustomDataGridCellsPanel IsItemsHost="True" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
But my CustomDataGridCellsPanel is not used. It still uses the DataGridCellsPanel.
What am I doing wrong?
来源:https://stackoverflow.com/questions/6423001/set-itemspanel-of-a-datagridcellspresenter-via-style-not-working