Hi,
I saw the outlook sample, and I need to show a week view with days side by side like outlook 2007.
When I click "show work week" I see what I want, and I tried to figure out how to do it but no luck (I looked at the code). My week view looks like two columns with 3 or 4 days in the same column (like outlook 2003).
Also, is it possible to show the days from right to left?
Thanks
This post is a little old. But I thought there might be lots of Arabic, Persian and Hebrew users who would want to make the DayView right to left. I did it like this:
public partial class Form1: Form, Infragistics.Win.IUIElementCreationFilter {
private void Form1_Load(object sender, EventArgs e) { ultraDayView1.CreationFilter=this; }
public void AfterCreateChildElements(UIElement parent) {
// if the mainUIElement of the DayView is being added if (parent is MainUIElement) {
// ChildElements 1-to-8 are the 7 days of the week, // invert their positions (1 to 7, 2 to 5, 3 to 4) for (int i = 1; i < 4; i++) { GroupUIElement col1 = (GroupUIElement)parent.ChildElements[i]; GroupUIElement col2 = (GroupUIElement)parent.ChildElements[8-i]; Rectangle rect1 = ((GroupUIElement)parent.ChildElements[i]).Rect; Rectangle rect2 = ((GroupUIElement)parent.ChildElements[8-i]).Rect; col1.Rect = rect2; col2.Rect = rect1; } } } public bool BeforeCreateChildElements(UIElement parent) { return false; }
}
Note that this only works if DayView is displaying 7 days of the week. For 5 days or any other number, you should make a little change to the numbers in the "for" clause (you should use something else instead of 4 & 8).
And please note that after doing this, a lot things won't work. like dragging appointments, or changing the days with keyboard arrows, or resizing day columns. So you better disable or rewrite them.
About the RightToLeft, as I said Infragistics has ignored that as far as I know, but I tried today to create my first creation filter and looks like it is very simple to do it:
{
parent.ChildElements[i].Rect = parent.ChildElements[parent.ChildElements.Count - (i + 1)].Rect;
parent.ChildElements[parent.ChildElements.Count - (i + 1)].Rect = rect;
I wonder if I can make more controls be right-to-left like that.
Amiram Korach said:1. Change the appointment back color according to some data and show red backcolor for a collision.
See Appointment.Appearance.BackColor. You can use the UltraDayView.CalendarInfo.GetAppointmentsInRange method to determine whether more that one appointment intersects with a given time range.
Amiram Korach said: 2. Today should appear as any other day (not orange).
You can use the UltraDayView.CalendarLook.TodayAppearance/TodayHeaderAppearance to modify the way the current day is depicted.
Amiram Korach said: 3. Day header should show day of week name only but not day of month.
UltraDayView.DayTextFormat = "dddd";Note that there was a bug that prevented this from working correctly, so you might need the latest hotfix for this.
Amiram Korach said: 4. Appointment tool tip should be the appointment description.
Handle UltraDayView's BeforeAppointmentToolTipDisplayed event, like so:private void dayView_BeforeAppointmentToolTipDisplayed(object sender, BeforeAppointmentToolTipDisplayedEventArgs e){ e.ToolTipText = e.Appointment.Description;}
Amiram Korach said:Do you know if I can also make those happen: 1. Change the appointment back color according to some data and show red backcolor for a collision. 2. Today should appear as any other day (not orange). 3. Day header should show day of week name only but not day of month. 4. Appointment tool tip should be the appointment description.
Do you know if I can also make those happen:
1. Change the appointment back color according to some data and show red backcolor for a collision.
2. Today should appear as any other day (not orange).
3. Day header should show day of week name only but not day of month.
4. Appointment tool tip should be the appointment description.
Amiram - ALL of this can be achieved very easily. Please try searching the documentation and this forum for answers to these questions. many of these topics have been discussed MANY times in this forum already.
Sorry for the Rant but it gets very annoying to see the same questions asked over and over again because people won't go and search themselves.
CheersAaron (AKA Grumpy)
Thanks! this works.
About the RightToLeft, unfortunately Infragistics has not implemented that in any control.