It seems like column.CellAppearance.BackColoroverrides grid.DisplayLayout.EmptyRowSettings.CellAppearance.BackColor?
Is there an alternative way to set the BackColor of empty rows?
Hello Yong,To answer your question, an alternative solution to prevent the Column CellAppearance BackColor from overriding the EmptyRowSettings CellAppearance BackColor is to use a DrawFilter.
The following code sample demonstrates how to use a DrawFilter for the EmptyRowSettings CellAppearance:
// Add this line of code to the Form Constructor to set// the UltraGrid DrawFilter Property to the EmptyRowDrawFilter
ultraGrid1.DrawFilter = new EmptyRowDrawFilter ();
Add the following Class to the program:
public
class EmptyRowDrawFilter : IUIElementDrawFilter{ #region IUIElementDrawFilter Members bool IUIElementDrawFilter.DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams) { drawParams.AppearanceData.BackColor = Color.White; return false; } DrawPhase IUIElementDrawFilter.GetPhasesToFilter(ref UIElementDrawParams drawParams) { if (drawParams.Element is EmptyRowCellUIElement) { return DrawPhase.BeforeDrawBackColor; } return DrawPhase.None; } #endregion}Please let me know if the above code provides the functionality you require or if you have any questions.Thank you.Sincerely,Mike D.Developer Support EngineerInfragistics, Inc.