Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
80
DisplayLayout.EmptyRowSettings.CellAppearance question
posted

It seems like
column.CellAppearance.BackColor
overrides 
grid.DisplayLayout.EmptyRowSettings.CellAppearance.BackColor?

Is there an alternative way to set the BackColor of empty rows?

Parents
No Data
Reply
  • 2501
    posted

    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 Engineer
    Infragistics, Inc.

Children
No Data