'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
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;
}
3条答案
按热度按时间70gysomp1#
使用“超网格.显示布局.覆盖.筛选单元格外观”来实现。
ergxz8rk2#
我想你可能在寻找类似这样的东西。在这个例子中,我使选定的行颜色“消失”,但你可以设置他们为任何颜色你想要的。
iezvtpos3#
调整外观的最佳方法是在UltraGrid控件的InitializeLayout事件中,而不是调整Designer文件。在设计时,可以双击UltraGrid以挂钩到上述事件。然后,可以对下面的单行进行注解和取消注解,以了解在为控件应用所需的筛选器后的最终效果: