Hi.... I am using XamMonthCalendar in my project and i am displaying data based on selection.But i should not able to select the dates beyond today.Say today is 25-06-2012 and dates after this should not able to select.How can i do this.Plz help me by solving this......
Thanks... its working fine....
Hi,
You can use then DisabledDates collection(paste this code in Loaded event for example):
Infragistics.Windows.Editors.CalendarDateRange c = new Infragistics.Windows.Editors.CalendarDateRange(DateTime.Now.AddDays(1), new DateTime(9999, 12, 31));
xamCalendar.DisabledDates.Add(c);
Also you can change disabled dates appearance using a Style:
<Style TargetType="{x:Type igEditors:CalendarDay}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="Red"></Setter>
</Trigger>
</Style.Triggers>
</Style>
Hope this helps you,
Regards,
Anastas
hey this not right..... i want to display the dates but i should not able to select the dates.Got it?
In this dates visibility is hidden so that i am not able to view future dates.this is not correct.I don't want to select that all,i can view the dates.....
You can use XamMonthCalednar's MaxDate property like this:
<igEditors:XamMonthCalendar MaxDate="{x:Static sys:DateTime.Now}" />.
Where sys is xmlns:sys="clr-namespace:System;assembly=mscorlib".