using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using System.Text;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;

namespace _13
{
    class MyDraw:IUIElementDrawFilter
    {
        #region IUIElementDrawFilter Members

        public bool DrawElement(DrawPhase drawPhase, ref UIElementDrawParams drawParams)
        {
            RowUIElement row = (RowUIElement)drawParams.Element.GetAncestor(typeof(RowUIElement));
            if ((int)row.Row.Cells[0].Value % 3 == 0)
            {
                drawParams.AppearanceData.BackColor = Color.Red;
            }
            return false;
            //return ((int)row.Row.Cells[0].Value % 3 == 0);
        }

        public DrawPhase GetPhasesToFilter(ref UIElementDrawParams drawParams)
        {
            if ( !(drawParams.Element is RowSelectorUIElement) && drawParams.Element.GetAncestor(typeof(RowUIElement)) != null)
            {
                return DrawPhase.BeforeDrawBackColor;
            }
            return DrawPhase.None;
        }

        #endregion
    }
}
