Hi
I saw how to mark holidays on the calendar using the this link "http://es.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://es.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>
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
Hello Ranjith,
Thank you for the provided details. I have spent more time on this and created a sample project for you. I am using two collections of items for the USDates and UKDates that contains a date and a description. When the user selects an item from the list the DataContext of the calendar is changed based on it. In order to apply the tooltip a MultiValueConverter is used and if the calendar start date is the same as an item from the DataContext, collection the description is returned.
I hope this solution is helpful for you.
Thanks. It helps.
Thank you for your feedback Ranjith.
I am glad that this helped you and I believe that this could be helpful for other community members as well.
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?
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.