WPF Datagrid,设置组合框弹出窗口的背景

发布于 2024-08-11 01:17:47 字数 182 浏览 5 评论 0原文

我想在 WPF 工具包数据网格中使用 DatagridComboboxColumn 时更改弹出背景的颜色。我已经编辑了普通组合框的模板,它非常适合所选项目和其他属性,但背景保持白色。我已经使用 Snoop 对模板进行了一些研究,它声称 DropdownBorder 的背景是由父模板设置的,但我无法弄清楚那是哪个模板。

有什么想法吗?

I would like to change the color of the popup background when using a DatagridComboboxColumn in the WPF Toolkit datagrid. I've edited the Template for a normal Combobox and it works great for selected item and other properties but the background stays white. I've used Snoop to do some research into the template and it claims that the DropdownBorder's background is set by the parent template but I can't figure out which template that is.

Any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

宫墨修音 2024-08-18 01:17:47

您必须更改 ItemContainerStyle,其中包含控制背景/选定颜色等的样式和模板。因为 ListBox 和 ComboBox 的 ItemContainerStyle 具有 IsSelected 属性,可用于设置更改背景颜色的触发器。

You have to change ItemContainerStyle, that contains style and template to control background/selected color etc. Because ItemContainerStyle of ListBox and ComboBox has IsSelected property that can be used for setting trigger for changing background color.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文