Hello,
I am trying to access the editor used to display appointments on the timelineview for each appointment. The reason I am trying this is because i want to set the barheight for each appointment differently. I know it is possible, I just want to know which direction I should go (overwriting the creationFilters method or any other way).
Thank you!
Ok so I managed to solve the problem with the help of a little digging.
TimeLineView has no way of modifying its appointments separately (visualy I mean), it has an object that is used as a template to draw them. However there is a way of altering them separately using CreationFilters. Here is the code below:
//this is used to modify the height of the appointment.
myTimeLineView.CreationFilter = new timeLineCreationFilter();
public class timeLineCreationFilter : IUIElementCreationFilter
{
void IUIElementCreationFilter.AfterCreateChildElements(UIElement parent)
}
bool IUIElementCreationFilter.BeforeCreateChildElements(UIElement parent)
if (parent is Infragistics.Win.UltraWinSchedule.TimelineView.AppointmentUIElement)
Infragistics.Win.UltraWinSchedule.Appointment appointment = parent.GetContext(typeof(Infragistics.Win.UltraWinSchedule.Appointment)) as Infragistics.Win.UltraWinSchedule.Appointment;
int newHeight = ((DataRow)appointment.Tag).Field<int>("newHeight");
parent.Rect = new Rectangle(parent.Rect.X, parent.Rect.Y, parent.Rect.Width, newHeight);
return false;
Hi,
How can I add a label inside my appointment? Could you show me some code?
I want to display multiline text.
hello,
well, you have to use creation filters. in the post above yours there is an example of a creation filter class.
after if (parent is Infragistics.Win.UltraWinSchedule.TimelineView.AppointmentUIElement) you simply add a TextUIElement inside the AppointmentUIElement.
The code should be something like:
TextUIElement txtUI = new TextUIElement(parent, "Whatever you want to write");
parent.ChildElements.Add(txtUI);
Hope it helps!
about multiline.. I don't know about that, but it should display multilines if you use the \n character inside the string. if not, one solution would be to place more textuielements, one under the other....
TextUIElement txtUI = new TextUIElement(parent, "Whatever you want to write");txtUI.MultiLine = true;txtUI.WrapText = true;parent.ChildElements.Add(txtUI);
but nothing shows up in the appointment.