Hi Team,
We are using WinSchedule control and my functionality has below behavior
1) Appointment Back color and fore color is based on some property of my appointment object (Its purely dynamic in nature). Whenever any appointment meet certain criteria appointment back and fore color changes accordingly while rendering WinSchedule control.
2) Whenever user select any appointment its back and fore color should remain as the appointment without selection.
We have a global Style file which we have applied to infragistic controls level and its applicable to all controls (Like button, grid, schedule etc)
Problem:
In point no. 2 above.
When i select appointment the fore color of an appointment get changed and take BLACK color (as it specified in style file for all selection in base tag.)
How can i override this behavior? I want after selection my appointment fore color should same as appointment before selection.
Solution tried:
1) Added node in style file (inl) for Scheduleappointment and mention the color for selection like below
<style role="ScheduleAppointment"> <states> <state name="Normal" foreColor="64, 64, 64" fontName="Segoe UI" fontSize="9" /> <state name="Selected" foreColor="64, 64, 64" /> </states> </style>
But this solution didn't meet my requirement. Its static in nature.
2) In Appointment creation filter it tried to set StyleFile and StyleResouse Name to override for appointment Like
appt.Appearance.StyleLibraryName = string.Empty; appt.Appearance.StyleResourceName = string.Empty;
But didn't work.
Please suggest any solution
Hi,
Probably in your scenario, you would like to give precedence for the selected color over the one set in AppStylist. You can achieve this by using the ResolutionOrder property. You can read more at https://www.infragistics.com/community/forums/t/80929.aspx
Let me know if you need further assistance regarding this matter.
I have tried this
<componentStyle name="ScheduleAppointment" resolutionOrder="ControlThenApplication" />
As we have to set based on appointment fore color so i have removed the style for ScheduleAppointment from my style file.
Still don't work for me.
More information :
While rendering my main application window i have applied style
Infragistics.Win.AppStyling.StyleManager.Load("MyStyle.isl");
Is it possible to bi-pass application style for UltraCalendarInfo class?
Please suggest or provide sample code to override style.
I created sample as per your requirement and indeed the resolution order is not honored even when changed in the style library. Therefore, I have submitted this issue in our internal development tracking system for further investigation under ID 239061. I also created a case for you CAS-185136-L9N2B6 and I will update you for the progress of this issue via the mentioned case. You could reach out your case following the link at https://www.infragistics.com/my-account/support-activity In order to view the status of all your development issues you should log into your account.
In order to disable AppStylist for any schedule control, you can set UseAppStylist to false. The CalendarInfo has the same property but it gives precedence over the one in the control.
I also attached my testing sample application to confirm with you that it is the same scenario as yours. As you can see, I would expect the background color to be Pink as the resolution order is ControlThenApplication in the style library.
Please let me know if you have additional questions regarding this matter.
Yes, exactly i am facing the same problem. In my case, i have style for selected items in Base that stops me to change the behavior (ForeColor) while selecting an appointment.
I am unable to override it through my code.
I also tried with UseAppStyling but didn't work.
this.ultraMonthViewSingle1.CalendarInfo.UseAppStyling = false; this.ultraMonthViewSingle1.CalendarInfo.Appointments[0].Appearance.BackColor = Color.Pink; this.ultraMonthViewSingle1.CalendarInfo.Appointments[0].Appearance.ForeColor = Color.Blue;