Is there a way in CalendarView to scroll to specific time? Because i want the first hour that user will see to be 8am in top of screen and not the 12am
Hi Peter,
Unfortunately, you can't currently do that. However, I agree it was a feature I overlooked when I wrote the control, and we're going to be add it as fix in the next public SR.
I can have you appended to the case so that you're notified when it is released.
-SteveZ
I had put it in ideas recently, but i ask it again here for some workaround etc.
Yes i would like to have a notify when released this will be very helpful thank you very much.
Hello Peter,
I have opened a private case for you so that I can link it to this development issue. This way you will be notified automatically when the dev issue is updated. The case number is CAS-134169-N0M9X3. You will see it located here: https://ko.infragistics.com/my-account/support-activity
Let me know if you have any questions regarding this matter.
We use the ContentOffset on the Scroll View to accomplish this. I've attached the code we use. It may help you out.
/// <summary> /// The default behaviour for calendar view is to display the day starting at midnight. /// Since most appointments start in the morning, we need to shift the view to start at that time. /// Each day is 80 units. The default view also leaves 40 units on top. /// We would like to start at 7am which is 40 + 7 * 80 or 600 units. /// However, this would cut off the "7" at the top of the view. Hence, we adjust this value /// enough for things to look reasonable. This is how we ended up with 595. /// </summary> /// <returns>The day scroll view.</returns> private void InitCalendarDayViewScrollPosition () { try { // The list of views we are interested are in a particular heirarchy. // Since these get created/deleted in an arbitrary fashion, we need to // find these views by name. UIView calendarViewContainer = GetView (mCalendar, "CalendarViewContainer"); if (calendarViewContainer != null) { UIView dayView = GetView (calendarViewContainer, "DayView"); if (dayView != null) { UIView multiDayViewArea = GetView (dayView, "MultiDayViewArea"); if (multiDayViewArea != null) { UIScrollView scrollView = null; // At this point we assume the remaining views are "UIScrollView, DayViewArea, UIScrollView". // Note that if this is not the case then we will simply throw an exception and bail. scrollView = (UIScrollView)multiDayViewArea.Subviews [0].Subviews [0].Subviews [0]; // Get the current offset of the view. float y = scrollView.ContentOffset.Y; // The default for the calendar view is 0. We only want to change this value if it is not // set already. The calendar view keeps track of the current offset which can be set // dynamically here or by the user. In either case, we do not want to update that value. if (y == 0) { scrollView.SetContentOffset (new PointF (0, 595), true); } } } } } catch (Exception) { // Note that we do not care if we get an exception here. // It just means that we won't be setting the scroll position and will default // to whatever the calendar would have displayed anyways. } }
Thank you for the response.
Work for a quick workaround until the release that will have it as fix