Working with day view, I am needing to determine the size of the underlying day view calendar element. For instance, say I can see appointments for noon thru 4pm, but I am not able to see 8am-noon without scrolling. I know the bounds of the contol and the bounds of the client area, but how can I determine the size of whole document if my monitor was big enough to see everything without scrolling.
Thanks!
Bob
To answer the question regarding "...the UIElement of the dayview "Container" controls": The containing UIElement for the TimeSlotUIElements is the Infragistics.WIn.UltraWinSchedule.DayView.DayUIElement. Note, however, that the height of the DayUIElement is not made to exceed the height of the control, and thus does not reflect the height of the scroll universe.
The solution posted here is perfectly sound; since the height of all TimeSlotUIElements is always the same, you can use the height of any TImeSlotUIElement, and multiply it by the number of time slots, which you can obtain from the Count property of the UltraDayView.TimeSlots collection.
Oh and part two of your question. Is it possible to set the size of the underlying dayview schedule... No... no easy way anyways. To Quote the wisdomful Brian F from an Forum Archive Post:
Brian F said:The only way to reduce the height of TimeSlots is by changing the FontSize of either the UltraCalendarLook's AppointmentAppearance, or the control's Appearance. For obvious reasons the TimeSlots can not be permitted to become shorter than the height required to display Appointment text.
The only way to reduce the height of TimeSlots is by changing the FontSize of either the UltraCalendarLook's AppointmentAppearance, or the control's Appearance. For obvious reasons the TimeSlots can not be permitted to become shorter than the height required to display Appointment text.
Hope this helps
CheersAaron
I guess you could derive the "height" of the entire "dayview" by calculating it from the timeslot height.
Get the height of a single timeslot and multiply it by the count of timeslots.
TimeSlots.Height * TimeSlots.Count = FullDayViewHeight
You could retrieve a timeslot Height by doing the following:
Private Function GetTimeSlotHeight() as Integer Dim TimeSlotUI As Infragistics.Win.UltraWinSchedule.DayView.TimeSlotUIElement TimeSlotUI = Me.UltraDayView1.UIElement.GetDescendant(GetType(Infragistics.Win.UltraWinSchedule.DayView.TimeSlotUIElement)) Return TimeSlotUI.Rect.HeightEnd Function
Now we are simply deriving the control height by using the timeslot height... but I am sure there is probably a particular single UIElement we could reference and get the height of.
Perhaps a Kind Infragistics employee can tell us the UIElement of the dayview "Container" controls. If we knew what the larger "container" control is then the process would still be very similar to above.
If you are just trying to get a particular TimeSlot Visible depending on a time then why not just use TimeSlot.EnsureVisible . That should do the trick for scrolling it backup to the top etc. UltraDayView1.TimeSlots(0).EnsureVisible
RegardsAaron