Hi,
I have a timeline view with appointments that display start/end times and subject. When there is insufficient room to display both the times and the subject the start/end times are not shown. This is excellent!
However, when there is insufficient room to display the subject by itself, the subject gets trimmed. I would like the appointment subject to display only when there is enough room to display it completely, but there is no text trimming option to do this.
Is there another way I can achieve the desired result?
Regards, Jim.
Hristo,
I'm not sure I've quite got the font settings right as this solution still sometimes chops off the last letter of the subject, but it is a big improvement and gives me something to work with.
Thanks for your assistance, Jim.
Hello,
What you could do is to Create own implementation of Creation filter, get Subject from appointment associated with AppointmentTimeUIElement and to check if the subject will fit to the available space of the appointment. Base on this you could decide what to display as text of the appointment. To check if the appointment has enough width to display subject without trimming. I set subject to a text property of a label (because label will resize itself in order to display the whole text) and if the label.Width is more that AppointmentTimeUIElement’s width this mean that the subject can’t fit in the available space. If you use some fonts and other fonts setting for appointment you should apply them and on the label.
Please see attached sample for your reference.
Let me know if you have any further questions.
Thank you for your response, however it does not really answer my question. I expect I was not very clear, so I will try again.
I am already using AppointmentDisplaySettings, as follows:
DisplayLocation = DefaultableBoolean.Fals DisplaySubject = DefaultableBoolean.True RecurrenceIndicatorVisibility = TimelineViewRecurrenceIndicatorVisibility.None ReminderIndicatorVisibility = TimelineViewReminderIndicatorVisibility.None TimeVisibility = TimelineViewAppointmentTimeVisibility.BothOnLeft DateTimeContinuationIndicatorVisibility = TimelineViewDateTimeContinuationIndicatorVisibility.Both BarColorIndicatorVisibility = TimelineViewBarColorIndicatorVisibility.Hide
DisplaySubject = DefaultableBoolean.True RecurrenceIndicatorVisibility = TimelineViewRecurrenceIndicatorVisibility.None ReminderIndicatorVisibility = TimelineViewReminderIndicatorVisibility.None TimeVisibility = TimelineViewAppointmentTimeVisibility.BothOnLeft DateTimeContinuationIndicatorVisibility = TimelineViewDateTimeContinuationIndicatorVisibility.Both BarColorIndicatorVisibility = TimelineViewBarColorIndicatorVisibility.Hide
RecurrenceIndicatorVisibility = TimelineViewRecurrenceIndicatorVisibility.None ReminderIndicatorVisibility = TimelineViewReminderIndicatorVisibility.None TimeVisibility = TimelineViewAppointmentTimeVisibility.BothOnLeft DateTimeContinuationIndicatorVisibility = TimelineViewDateTimeContinuationIndicatorVisibility.Both BarColorIndicatorVisibility = TimelineViewBarColorIndicatorVisibility.Hide
ReminderIndicatorVisibility = TimelineViewReminderIndicatorVisibility.None TimeVisibility = TimelineViewAppointmentTimeVisibility.BothOnLeft DateTimeContinuationIndicatorVisibility = TimelineViewDateTimeContinuationIndicatorVisibility.Both BarColorIndicatorVisibility = TimelineViewBarColorIndicatorVisibility.Hide
TimeVisibility = TimelineViewAppointmentTimeVisibility.BothOnLeft DateTimeContinuationIndicatorVisibility = TimelineViewDateTimeContinuationIndicatorVisibility.Both BarColorIndicatorVisibility = TimelineViewBarColorIndicatorVisibility.Hide
DateTimeContinuationIndicatorVisibility = TimelineViewDateTimeContinuationIndicatorVisibility.Both BarColorIndicatorVisibility = TimelineViewBarColorIndicatorVisibility.Hide
BarColorIndicatorVisibility = TimelineViewBarColorIndicatorVisibility.Hide
I have explored the Appearance.TextTrimming options, but there is no option to display nothing when there is insufficient room to display the full text.
I have investigated using a draw filter to filter the TextUIElement and thought I was getting somewhere when I discovered the IsTextFullyVisible property, but this seems to return true regardless.
So... I want to display time and subject, but only when there is room to display the full text. The time is already removed when there is no room for both, but I can only trim the subjext text to words or characters, not competely.
Any help would be appreciated.
Appointment object has a property Appearance.TextTrimming, which allows you to choose how the text will trimmed, also please look at ultraTimelineView1.AppointmentDisplaySettings. Using this you could determine which component should be displayed on appointments. Like you could choose to display or not subject for example:
ultraTimelineView1.AppointmentDisplaySettings.DisplaySubject = Infragistics.Win.DefaultableBoolean.True;
The settings that you set for AppointmentDisplaySettings will be applied for all appointments, so if you want to set different display text to each appointment you should use creation filter. What I mean is: one appointment to display start/end date, other to display subject and etc. then you should use creation filter to get AppointmentTimeUIElement and set it Text property to desired text that you want to be displayed on this appointment, based on some criteria (you could get Appointment object associated to AppointmentTimeUIElement, you could use AppointmentTimeUIElement.Appoitment).
In the following link you could find more information about the CreationFilter:
http://help.infragistics.com/Help/NetAdvantage/WinForms/2010.2/CLR2.0/html/Win_Creation_Filter.html