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
505
How to iterate all TimeSlot in TimelineView
posted

Can I iterate alls TimeSlotUIElement in the UltraTimeLineView control in Form_Load() events to make AppointmentUIElement equal (fill) to these TimeSlotUIElement.

my timelineview control have only one appointment per day, and that appointment does not span across multiple days

  • 69832
    Verified Answer
    Offline posted

    Strictly speaking, the answer to your question is no, because in Form_Load the control has not yet painted, and no UIElements are available until it has.

    Assuming that what you want to do is make the appointment  the same size as the TimeSlotUIElement, yes, you can do that using the IUIElementCreationFilter interface. In this simple case the implementation should be rather straightforward:

    1) In the AfterCreateChildElements implementation for ActivityAreaUIElement, iterate the ChildElements collection and add each TimeSlotUIElement to a dictionary with the date as the key and the element as the value.
    2) Iterate the ChildElements collection again in a second pass, this time grabbing each AppointmentUIElement. Use its StartDateTime property to find the accompanying TimeSlotUIElement in the dictionary, then make the AppointmentUIElement's Rect the same as the TimeSlotUIElement.RectInsideBorders.