Is there a possible way to synchronize the date changed by the timelineViews scroll bar
with calendarinfo?
Thanks.
You can do something like the following to set the ActiveDay to the date of the first DateTime displayed by the control:
using Infragistics.Win;using Infragistics.Win.UltraWinSchedule;
this.timeLineView.ColumnHeaderInitializing += new ColumnHeaderInitializingHandler(timeLineView_ColumnHeaderInitializing);
void timeLineView_ColumnHeaderInitializing(object sender, ColumnHeaderInitializingEventArgs e){ UltraTimelineView control = sender as UltraTimelineView; UltraCalendarInfo calendarInfo = control.CalendarInfo; DateTime activeDate = calendarInfo.ActiveDay != null ? calendarInfo.ActiveDay.Date : DateTime.Today;
if ( e.DateTimeInterval.IsPrimaryInterval ) { DateTimeRange range = e.DateTimeRange; if ( range.StartDateTime.Date != activeDate ) calendarInfo.ActivateDay( range.StartDateTime.Date ); }}
The control exposes a 'SynchronizeWithActiveDay' property, but this works in the other direction, that is, when the ActiveDay changes, the control hears this and brings that date into view. The reason the property is not bi-directional is that TimelineView is similar to DayView in the sense that it displays time slots, but also can be displaying multiple days (or weeks, months, years for that matter) so the concept of "which day is it displaying" gets murky.
After coding the above, I realized that we really should have an event that fires when the first visible DateTime displayed by the control changes, so I entered a bug along those lines. This functionality will be available in a forthcoming service release.
First Thanks, but that not working well.
Please run your code on timeLine with Primary interval of DateInterval: 2 Weeks for instance.
Yes, terribly sorry, it looks like you will have to wait for the new event.
Hi Brian
I have just installed Infragistics new SR 20092.2042 and found new time line event Infragistics.Win.UltraWinSchedule.VisibleDateTimeRangeChangedHandler
This serve our purpose to synchronize between dates range of the time line and other win schedule controls.