开发者

How can I change the background color of the Infragistics' UltraGrid filter row?

Currently this is what it looks like:

How can I change the background color of the Infragistics' UltraGrid filter row?

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

How can I change the background color of the Infragistics' UltraGrid filter row?

I've tried changing what I think is the property to magenta or something that stands o开发者_如何学Cut in an attempt to find out what property I need, but so far no dice.

Any ideas?


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


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


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;
    }
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜