'How can I change the background color of the Infragistics' UltraGrid filter row?
Currently this is what it looks like:
I'd like to change that blue color, but I don't know what property to change.
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?
Solution 1:[1]
Use "ultraGrid.DisplayLayout.Override.FilterCellAppearance" for that.
Solution 2:[2]
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
Solution 3:[3]
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;
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | Alexander Schmidt |
Solution 2 | |
Solution 3 | Danko Valkov |