Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
65
TimeLineView and ultraToolbarsManager bug ?
posted

Hello,

I'm using TimeLineView and ultraToolbarsManager in the same form and I use a creation filter for Appointment.

When I change Appointment.Appearance.ImageBackground for my appointment in this creation filter the ultraToolbarsManager frizz, I can't use it anymore...

I try it in a single test project (attached) nothing else in it, but still doesn't work...

Am I wrong ?

Thanks

My Form :

namespace ribbon_timeline
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

// Use custom creation filter
cf_appointment cf = new cf_appointment();
this.ultraTimelineView1.CreationFilter = cf;

// Hide
this.ultraCalendarInfo1.Owners.UnassignedOwner.Visible = false;

// Add owner
this.ultraCalendarInfo1.Owners.Add("Id", "Name");
// Get Owner
Owner owner = (Owner)this.ultraCalendarInfo1.Owners.GetItem(ultraCalendarInfo1.Owners.IndexOf("Id"));

// Create appointment
Appointment appointment1 = new Appointment(DateTime.Now, DateTime.Now.AddHours(2));
appointment1.Subject = "Subject";
appointment1.Owner = owner;
// Add Appointment
this.ultraCalendarInfo1.Appointments.Add(appointment1);

}
}
}

CreationFilter :

namespace ribbon_timeline
{
class cf_appointment : IUIElementCreationFilter
{
public void AfterCreateChildElements(Infragistics.Win.UIElement parent)
{
if (parent is AppointmentUIElement)
{
AppointmentUIElement appointment = parent as AppointmentUIElement;

if (appointment != null)
{
appointment.Appointment.Appearance.ImageBackground = images.diagonals as Bitmap;
appointment.Appointment.Appearance.ImageBackgroundStyle = Infragistics.Win.ImageBackgroundStyle.Tiled; // repeate image
}
}
}

public bool BeforeCreateChildElements(Infragistics.Win.UIElement parent)
{

return false;
}
}
}

ribbon_timeline.zip
Parents
No Data
Reply
  • 23930
    Verified Answer
    Offline posted

    Hi,

    Thank you for posting in our forums and for providing the test project.

    The CreationFilter is not the place to visually change (i.e. change the appearance, image, colors, etc.) the control. If you need to do this through some of our filters, the recommended one is the DrawFilter. The CreationFilter is used to change the structure of the UIElements, by adding new elements, removing existing ones, changing their location or size, etc.

    My assumption why the issue is happening is that setting the ImageBackground property directly, intercepts the paint events of the toolbar. If you create class level appearance variable in the filter and use it for the appointment appearance the sample works correctly.

    I have attached a modified version of your sample to demonstrate this suggestion. It also has a draw filter, that achieves the same thing and also it adds the appearance through the TimeLine itself.

    Please let me know if you have any additional questions.

    ribbon_timelineMod.zip
Children