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
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.
Worked like a charm - thank you very much.
Hi Bob,
in my case only the ForeColor of the AppearanceData object has an effect on the header. All the other properties (except text alignment and the text itself via "e.Text") seem to be ignored. Do have any suggestion on this?
Best regards
Achim
It turns out there is an easier way to do this. You can handle the ColumnHeaderInitializing event off the UltraTimeLineView and include some code like this:
if (e.DateTimeRange.StartDateTime < DateTime.Now && e.DateTimeRange.EndDateTime > DateTime.Now) { AppearanceData appData = new AppearanceData(); appData.BackColor = Color.Goldenrod; e.AppearanceData = appData; }
So you don't really need a DrawFilter.