It looks like XamMonthView autocreates 1 year work of visible days and the user can use the vertical scrollbar to navigate.
How can I disable this feature, I want to show only the days as selected by the xamMonthCalendar. i.e Only 1 month.
Hello,
If you want to disable the scrolling functionality altogether, you could alter the template of the XamMonthView. You can find a default template for it in the generic.shared.xaml file. You just need to set the Visibility property of the ScrollBar named WeekScrollBar to collapsed.
That would result in the ScrollBar never being actually displayed.
Regards,
Ivan
Hi Ivan,
I modified the generic.shared.xaml as shown below:
<ScrollBar igLayout:GridBagPanel.Column="1" igLayout:GridBagPanel.Row="1" Orientation="Vertical" Visibility="Collapsed" Style="{TemplateBinding ScrollBarStyle}" x:Name="WeekScrollBar" />
But still the scrollbar appears allowing me to scroll from 7-Dec-2009 to 7-Nov-2011, even though, I have set the visible date range as 1-Nov-2010 to 5-Dec-2010.
The reason for this result is that the styles of the controls are actually loaded from the dlls. In this case the XamSchedule.dll. The generic.shared.xaml file simply provides default styles so that you don't have to guess what is the Template of the control.
What you need to do is copy the style from the generic.shared.xaml into the resources of your container (page, grid...) and then modify it. Then when the application starts up the newly provided style would override the one from the assembly.
I'm attaching a project which demonstrates how to do that. Since i didn't know if you were using WPF or Silverlight, the project works for both. For WPF simply set the WPF project as StartUp
Regards
Thanks for the sample.
I actually had a separate generic.shared.xaml which I load as ResourceDictionary in App.Xaml.
It looks like setting the Visibility to Collapse didn't work. I now follow what you did in your sample and commented out the "WeekScrollBar" and that works.
Thanks for your help.
Best Regards,
Steven