Hello,
I need to add more text to a day in the month view single. Currently I am using notes but I can't seem seem to get the proper spacing to display all the information that I want. Is there a way to control the text and font of the day, or change the spacing of the notes?
Below is what it currently looks like:
Hello Alkali Feldspar,
Alkali Feldspar said:Is there a way to control the text and font of the day, or change the spacing of the notes?
If I understand well your requirements, maybe one possible approach to modify the Font size of your appointments, could be through your UltraCalendarLook. You could add UltraCalendarLook to your UltraMonthViewSingle controls and use the properties:
ultraCalendarLook1.AppointmentAppearance.FontData.SizeInPoints = 12F;ultraCalendarLook1.AppointmentAppearance.FontData.Bold = Infragistics.Win.DefaultableBoolean.False;ultraCalendarLook1.AppointmentAppearance.FontData.Italic = Infragistics.Win.DefaultableBoolean.False;ultraCalendarLook1.AppointmentAppearance.FontData.Strikeout = Infragistics.Win.DefaultableBoolean.True;ultraCalendarLook1.AppointmentAppearance.ForeColor = Color.Red;
Let me know if you have any questions
Changing the fond size does allow for more text to display.
I am still wondering if there is a way to reduce the amount of space between appointments / notes to allow me to display more of them in a day. As well, is it possible to have a note display more than on line of text?
Thanks,
HelloIf you still have any concerns or questions I will be glad to help. If you need any additional assistance don’t hesitate to ask.
Regads
Hello Alkali,
By default the size depend of FontSize. Of course you could reduce the size of UIElements if you are using CreationFilter, for example with the code below:
public class CreationUIElement : IUIElementCreationFilter { private int heigh; private int currentHeigh; public CreationUIElement(int Heigh) { heigh = Heigh; }
public void AfterCreateChildElements(UIElement parent) {
DayUIElement El = parent as DayUIElement; if (El != null && El.ChildElements.Count > 0) { currentHeigh = 25; foreach (SingleDayAppointmentUIElement item in El.ChildElements.OfType<SingleDayAppointmentUIElement>()) { item.Rect = new Rectangle(item.Rect.X, El.Rect.Y + currentHeigh, item.Rect.Width, heigh); currentHeigh = currentHeigh + heigh + 1 ; } } }
public bool BeforeCreateChildElements(UIElement parent) { return false; } }
Please take a look at the attached screenshot to see the difference. Nevertheless if you want to include more items, you should override our UltraMonthViewSingle controls (there are few classes. For example class MultiDayAppointmentSubjectUIElement : UIElement with private void AddChildUIElements() method.
Please let me know if you have any questions.
Regards
Ok, I've used a creation filter to add a TextUIElement to each DayUIElement on the calendar. In the creation filter I can change the text and it displays properly. However this is not where I need to set the text. Once the form has loaded I need to add the text; I am doing this by getting the DayUIElement:
Infragistics.Win.UltraWinSchedule.Day today = MonthView.CalendarInfo.GetDay(Date, true);
DayUIElement DayUIE = MonthView.UIElement.GetDescendant(typeof(DayUIElement), today) as DayUIElement;
Next I loop through the child elements of the DayUIElement to get to the TextUIElement I added in the creation filter like this:
foreach(UIElement UIE in DayUIE.ChildElements){ if (UIE is TextUIElement) { TextUIElement TextUIE = (TextUIElement)UIE;TextUIE.Text = "Some text"; } }
When I step through code I can see it setting the text on the TextUIElement, I can also see text in this element if I set it in the creation filter. However when I set the text in the above loop it does not seem to display it. How do I make it display this new text?
Maybe one custom approach could be if you are using CreationFilter to reduce the size of your UIElements and change the location of each UIElement.
Let me know if you have any further questions.