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
180
UltraTimeLineView - highlight current time
posted

Is it possible to highlight the time slots (column) that contains the current time.  I want to user to be able to see which time column contains the current time.  thanks

Parents
  • 9298
    posted

    Bob,

    There is no built-in way to do this, but you could achieve it by using a DrawFilter. 

    Something like this:

     class HighlightingDrawFilter : IUIElementDrawFilter

        {

            public bool DrawElement(Infragistics.Win.DrawPhase drawPhase, ref Infragistics.Win.UIElementDrawParams drawParams)

            {

                switch (drawPhase)

                {

                    case DrawPhase.BeforeDrawBackColor:

                        drawParams.Graphics.FillRectangle(new SolidBrush(Color.Yellow), drawParams.Element.RectInsideBorders);

                        return true;

                }

                return false;

            }

     

            public Infragistics.Win.DrawPhase GetPhasesToFilter(ref Infragistics.Win.UIElementDrawParams drawParams)

            {

                if (drawParams.Element is ColumnHeaderUIElement)

                {

                    DateTimeRange header = (DateTimeRange)drawParams.Element.GetContext(typeof(DateTimeRange));

     

                    if (header.StartDateTime < DateTime.Now && header.EndDateTime > DateTime.Now)

                    {

                        return DrawPhase.BeforeDrawBackColor;

                    }

                }

                return DrawPhase.None;

            }

        }

     

    Let me know if that works for you.

Reply Children