Set ItemsPanel of a DataGridCellsPresenter via Style not working

試著忘記壹切 提交于 2019-12-22 10:25:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!