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
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;}
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)?
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
I have similar requirement.
" I want to change layout of some dates and also want to show tool tip on mouseover."
Currently I try with WebCalendar control and implement RenderDay event using Java Script (Since RenderDay can be implement using clientscript only). But ClientScript implementation is not able to access any server-side objects and also RenderDay doesn't provide any reference to base cell object.
Is there any way to achieve the same ( may be using some other control)?
Since simple ASP.Net calendar control provide server-side implementation of OnDayRender event
and also give reference to cell object, so that developer can able to play with these object.
Is this possible in infragistics?
Derek,
This response was much more informative than what I received from the issue submission and I thank you for that. I follow you completely concerning the implementation of WebCalendar RenderDay vs. WebMonthView for the reasons you pointed out.
Although, I think a similar methodology could be applied. It appears as though WebMonthView renders into a table where the month day number and month day are ultimately table cells, then each appointment is render as a div in that cell. If Infragistics were to interject a PreDayRender or DayRender where the EventArgs contained some DayCell and a List of AppointmentDiv objects. This would put the power in the hands of the developer.
If a developer was to implement this event it would go something like (the following would just create the default output.)
protected void WebMonthView_DayRender(object sender, DayRenderEventArgs e) { foreach (AppointmentContainer apt = e.Appointments) e.Cell.Controls.Add(apt); }
Where e.Appointments is a List of AppointmentContainer objects, each of which contains the "more complex markup" appointment, and e.Cell is the table cell of the day.
I think this would still allow for the custom JS to function correctly and provide the "hook" for when the developer has to add that one layer of custom functionality.
Thanks for your time.