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
100
Customize Appointment Order in MonthView Day Cell.
posted

Here is the short version:

I have a particular event (an event with a particular subject for instance) and I want this to aways be the first DIV it's corresponding day cell in the month view.

Any input would be helpful. So far, I have tryed to Inherit from WebMonthView and create custom WebControlAdapter, neither of these allow me to see into the "day" cell or collection or anything. I have also tryed creating a CustomDataProvider and Modified the Appointments during DataBinding (the following allow me to set custom colors for known events)

AppointmentsSubsetCollection events = WebScheduleInfo.GetAppointmentsForDate(WebScheduleInfo.ActiveResource, myStartDate);
foreach (Appointment ev in events)
{
  ev.Style.BackColor = myCustomColor;
}

With the above code I have also tryed to remove my known events and then re-add them at Index=0 but it still seems to be based on the

IComparer.Compare(object x, object y)

found in Infragistics.WebUI.WebSchedule.ActivitiesSubset

Some more details:

When 2 or more events start at the same time (in my case 12:00am) there is no control over which is shown first. I need control over this. More importantly I would like to have control over the render order of the events in each day. I feel that this should be possible without source code re-compile (this has created problems in the past)

Best case:

I am looking for the kind of control you have in the OnDayRender of the standard .NET Calendar control.

A little more:

Is there any control over the style of each day number in the monthly view (I.E if day has event 'x' then bgcolor=blue)?

Parents
No Data
Reply
  • 4960
    Verified Answer
    posted

    The order of appointments in a WebMonthView day compartment is based on increasing start time, so an appointment with a StartDateTimeUtc = midnight will appear first before one with a StartDateTimeUtc = 5:00 AM.  It's not alterable, it will come like that out of the server-side Render( ) method.

    WebCalendar has very basic day content (the day number), so developers can be encouraged to override renderDay and specify their own content on the fly.  WebMonthView on the other hand renders more complex markup inside of its days, and its Javascript depends on being able to reach appointment divs in reaction to their being selected or refreshed, etc. So it would have been difficult to expose an event like the simpler WebCalendar's renderDay in such a way that any customizations you or other developers might make to the markup wouldn't adversely impact these interactive features.

    I am sorry it was difficult to get the WebMonthView to handle your scenario more easily. You highlight scenarios which show there is room in which we can improve the customizability of the WebMonthView's day rendering. I invite you to discuss with us what you'd like to see in such functionality.  

    If we did have a render day event, how would you want a render day event to work? Instead of a render day event, could a property that switches the default ordering of appointments based on an enumeration of fields (e.g., Increasing Start Time, Decreasing Start Time, Subject (Alphabetical), Importance) help?  What if there was a template property to give you greater control over defining the day content?

    We're always listening, let us know how you would like this control to work for you,

          http://devcenter.infragistics.com/Protected/RequestFeature.aspx

     

Children