Set ItemsPanel of a DataGridCellsPresenter via Sty

2019-05-11 13:52发布

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?

0条回答
登录 后发表回答