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
684
TimeSlot Owner
posted

What I need to do is to loop through all the TimeSlots in a DayView control and be able to determine for a given TimeSlot, who the Owner is.  Is there any way to do this?  I do not see any method or property on the TimeSlot itself that would lend a hand.

Or perhaps do I need to loop through some other collection to get to the TimeSlots for each Owner?

 Any help would be greatly appreciated.

Parents
No Data
Reply
  • 684
    Offline posted

    Is this a possible solution?

    foreach (TimeSlot timeSlot in dvDay.TimeSlots)

    {

    string sOwnerKey = null;

    // Get the TimeSlotUIElement for this TimeSlot

    Infragistics.Win.UltraWinSchedule.DayView.TimeSlotUIElement tsElement = null;

    // Get the Context DayUIElement for the TimeSlotUIElement

    tsElement = dvDay.UIElement.GetDescendant(typeof(Infragistics.Win.UltraWinSchedule.DayView.TimeSlotUIElement), timeSlot);

    if (tsElement != null)

    {

    Infragistics.Win.UltraWinSchedule.DayView.DayUIElement dayElement = (Infragistics.Win.UltraWinSchedule.DayView.DayUIElement)tsElement.GetContext(
    typeof(Infragistics.Win.UltraWinSchedule.DayView.DayUIElement), true);if (dayElement != null)

    {

    // Get the Owner from the DayUIElement

    sOwnerKey = dayElement.Owner.Key;

    }

    }

    }

Children