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
50
Changing BarAppearance.BackColor
posted

I'm using a styled application. In the .isl file I have styled the Bar with resolutionorder Default, which seems to be 'ApplicationThenControl'.

In my application I want to change the appearance of a bar according to some properties, so I use the following code (assuming that 'task' is an  Infragistics.Win.UltraWinSchedule.Task):

task.TimelineSettings.BarSettings.BarAppearance.BackColor = Color.Yellow;

in this configuration the color of the task isn't changed when I start the application. However when I set the resolution order in the style file to 'ControlThenApplication' the color is changed in my application, but other components of the UltraGanttView are no longer styled correctly. This behaviour is already shown in the Appstylist:

ApplicationThenControl:

ControlThenApplication:

In this example the TimeLineViewColumnHeaderWeeks is no longer styled correctly, but more important all working days that aren't in the initial view are styled incorrectly (in this example the first 5 days).

 

In short:If I understand the property correctly I need to use the setting 'ApplicationThanControl', but all styling I do in the application isn't performed. Is this a bug or the result of incorrect configuration by me?

kind regards

  • 53790
    Suggested Answer
    posted

    Hello Jaap Jan Nagel,

    It seems to me that is this behavior comes from your AppStyle which overrides the appearance properties of your controls. If you remove the resources and the set appearances that are set on the “Normal” state of the “GanttViewTaskBarElement” you would be able to set the desired properties through the code like:


    Task task2 = new Task();
    task2.Name = "Test 2";
    task2.TimelineSettings.BarSettings.BarAppearance.BackColor = Color.Pink;
    task2.TimelineSettings.BarSettings.BarAppearance.BackColor2 = Color.Yellow;
    task2.StartDateTime = DateTime.Today.AddDays(1);
    task2.Duration = TimeSpan.FromDays(4);
    ultraCalendarInfo1.Tasks.Add(task2);

    Please if you have any questions, do not hesitate to ask me.
    Regards