Hi
I saw how to mark holidays on the calendar using the this link "http://ko.infragistics.com/community/forums/t/74325.aspx"
I have another requirement on top of this. I would like to display a tool tip when users hover over the days marked as holiday in the calendar. The challenge here is that I have a List<IHolidays> object in the view model. IHolidays interface has two properties DATE and DESCRIPTION. This is the collection I iterate over to mark the disabled dates. Now, how do I use this to bring the tool tip as well.
Thanks,
Chev
Any replies please?
Thanks
I got this to work after having a look at this post
http://ko.infragistics.com/community/forums/p/42864/434462.aspx#434462
The above solution helps to display the tooltip for a date marked as holiday but when I use the below code (From one of the infragistics forum) to mark holidays with another color then the tooltip never appears. Can somebody please help?
<Style TargetType="{x:Type igEditors:CalendarDay}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<!--<Setter Property="Background" Value="PeachPuff"/>-->
</Trigger>
</Style.Triggers>
</Style>
Hello Ranjith and thank you for contacting Infragistics!
Days that are marked as holidays in the XamMonthCalendar are enabled and the IsEnabled property is true. If you want to set the tooltip only to holidays you may use the IsWorkday property:
<Style TargetType="{x:Type ig:CalendarDay}">
<Trigger Property="IsWorkday" Value="False">
<Setter Property="ToolTip" Value="I am tooltip"/>
<Setter Property="Background" Value="Yellow"/>
Please feel free to let me know if you have any other questions on the matter.
I don't seem to get you. Please note that users have option to select US, UK, China holidays from a listbox. When the country changes I populate the disableddates to include all the holidays. Hence all these holiday dates become disabled.
I apparently cannot set tooltip for disabled dates because the days are disabled. In this case how will IsWorkDay going to help me? Please note that whenever user selects a different country I populate a new list of values for the disabled dates collection. In this case how will IsWorkDay help me set the tooltip for the disabled dates. Please give me a sample project to explain.
Hello Chev,
I have attached a sample project that demonstrates how the IsWorkDay could be used in order to set a tooltip to the days that are marked as non-working on the calendar. I have been looking into your description and I am not completely sure how you mark the holidays. Do you set their IsEnabled property to false? Would it be possible to modify this sample project or provide another one with this implementation so I could investigate it further? Thank you.
Let me clearly explain my problem to you.
1. I have a UI where a list box will load with all country names. For each country there are different national holidays available and they are stored in the database.
2. When a user selects a country (Say U.S) and clicks on get holidays then I will fetch all holidays for U.S for a given year and I need to show all these holidays marked in a different color in the XamMonthCalendar.
3. I also have a dictionary of Holiday,holidayDescription in my database. This will be used whenever a user hovers over the mouse on a particular holiday date (Note: holidays need not necessarily be only sat and sunday) and he should be able to see a tooltip which shows what holiday the date corresponds to.
Kindly let me know if you do not get my problem yet. If so, I shall create an example project and send it.
Ranjith
Thank you for your feedback Ranjith.
I am glad this approach helped you and I believe that it will be useful for other community members as well.
Thanks much. We can close this issue.
Hello,
I am just checking your progress on the issue.
If you have any other questions regarding the CalendarDay styling, please feel free to ask.
Hi,
There is a MultiTrigger in the “CalendarItemInner” ControlTemplate that is hit when the user hovers a day. It applies custom color for that date. In order to disable this functionality you could retemplate the default template defined in the eitors.generic.xaml file at C:\Program Files (x86)\Infragistics\2013.2\WPF\DefaultStyles\Editors and remove the trigger. I have modified the sample project to show this approach. Please feel free to ask if you have any questions.
Just one more question. Like you have a setter for the tooltip property I also created one for the background property and I set the color based on if the date is a holiday or not. All works perfectly.
Now when I take my cursor over the date which is a holiday the tooltip appears but the color disappears. Any idea why and how this could be solved?