如何更改 Infragistics 的背景颜色? UltraGrid 过滤器行?

发布于 2024-11-26 02:53:30 字数 260 浏览 1 评论 0原文

目前看起来是这样的:

在此处输入图像描述

我想更改蓝色,但我不'不知道要改变什么属性。

在此处输入图像描述

我尝试将我认为的属性更改为洋红色或其他突出的属性,试图找出我需要什么财产,但到目前为止还没有骰子。

有什么想法吗?

Currently this is what it looks like:

enter image description here

I'd like to change that blue color, but I don't know what property to change.

enter image description here

I've tried changing what I think is the property to magenta or something that stands out in an attempt to find out what property I need, but so far no dice.

Any ideas?

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

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

发布评论

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

评论(3

_蜘蛛 2024-12-03 02:53:30

为此,请使用“ultraGrid.DisplayLayout.Override.FilterCellAppearance”。

Use "ultraGrid.DisplayLayout.Override.FilterCellAppearance" for that.

从此见与不见 2024-12-03 02:53:30

我想你可能正在寻找这样的东西。在此示例中,我使选定的行颜色“消失”,但您可以将它们设置为您想要的任何颜色。

'Make selected row look just like any other row
myUltraGrid.DisplayLayout.Override.ActiveRowAppearance.BackColor = Color.White
myUltraGrid.DisplayLayout.Override.ActiveRowAppearance.ForeColor = Color.Black

'Make selected cell look like any other cell
myUltraGrid.DisplayLayout.Override.ActiveCellAppearance.BackColor = Color.Black
myUltraGrid.DisplayLayout.Override.ActiveCellAppearance.ForeColor = Color.White

I think you may be looking for something like this. In this example I'm making the selected row colors "disappear", but you can set them to any color you want.

'Make selected row look just like any other row
myUltraGrid.DisplayLayout.Override.ActiveRowAppearance.BackColor = Color.White
myUltraGrid.DisplayLayout.Override.ActiveRowAppearance.ForeColor = Color.Black

'Make selected cell look like any other cell
myUltraGrid.DisplayLayout.Override.ActiveCellAppearance.BackColor = Color.Black
myUltraGrid.DisplayLayout.Override.ActiveCellAppearance.ForeColor = Color.White
怀念你的温柔 2024-12-03 02:53:30

调整外观的最佳方法是在 UltraGrid 控件的 InitializeLayout 事件中进行,而不是调整 Designer 文件。您可以在设计时双击 UltraGrid 以挂接到上述事件。之后,您可以对下面的单行进行注释和取消注释,以了解在为控件应用所需的过滤器后,最终的效果是什么:

 private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
    {
        //If the row is not the ative row, you would see that color instead.
        e.Layout.Override.FilterCellAppearance.BackColor = Color.Green;

        //This would be visible when the row has filters applies, and not being active at the same time.
        e.Layout.Override.FilterCellAppearanceActive.BackColor = Color.GreenYellow;

        //The appearance that would be applied after you filtered IN some of the rows based on your filters.
        e.Layout.Override.FilteredInCellAppearance.BackColor = Color.BlueViolet;

        //After a filter is applied, and FilteredInCellAppearance is not being set.
        e.Layout.Override.FilteredInRowAppearance.BackColor = Color.Pink;

        //If FilterCellAppearance is not being set, the one below would take effect.
        e.Layout.Override.FilterRowAppearance.BackColor = Color.Plum;

        //The formatting of the filter rows, that have active filters already.
        e.Layout.Override.FilterRowAppearanceActive.BackColor = Color.PowderBlue;
    }

The best way to tweak the appearances would be in the InitializeLayout event of your UltraGrid control, and not tweak the Designer files. You could double click on your UltraGrid, while in Design time, to hook to that mentioned event. Afterwards you could comment and uncomment the single lines below to get the idea what would be the end effect for you, after you apply the needed filters for your control:

 private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
    {
        //If the row is not the ative row, you would see that color instead.
        e.Layout.Override.FilterCellAppearance.BackColor = Color.Green;

        //This would be visible when the row has filters applies, and not being active at the same time.
        e.Layout.Override.FilterCellAppearanceActive.BackColor = Color.GreenYellow;

        //The appearance that would be applied after you filtered IN some of the rows based on your filters.
        e.Layout.Override.FilteredInCellAppearance.BackColor = Color.BlueViolet;

        //After a filter is applied, and FilteredInCellAppearance is not being set.
        e.Layout.Override.FilteredInRowAppearance.BackColor = Color.Pink;

        //If FilterCellAppearance is not being set, the one below would take effect.
        e.Layout.Override.FilterRowAppearance.BackColor = Color.Plum;

        //The formatting of the filter rows, that have active filters already.
        e.Layout.Override.FilterRowAppearanceActive.BackColor = Color.PowderBlue;
    }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文