This is a migrated thread and some comments may be shown as answers.

How to hide days outside of the current month?

11 Answers 296 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Arash Emami
Top achievements
Rank 1
Arash Emami asked on 22 Mar 2010, 06:22 PM
Hi, quick question.

Currently, the control shows the days that fall outside of the currently selected month (shows them as a gray color).

How can you make it not show those days at all?  I only want to show days available to the currently selected month.  Thank you

11 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 25 Mar 2010, 01:31 PM
Hello Arash,

Thank you for contacting us.

You can use the DayTemplateSelector property of the Calendar to remove the unnecessary dates. You can see an example of its use in this online demo.

If you need further assistance please feel free to contact us again.

Best wishes,
Konstantina
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Justin
Top achievements
Rank 1
answered on 01 Aug 2011, 08:02 PM
Konstantina, I am not seeing the DayTemplateSelector property to make this work.  I am using the most recent version of the Telerik Silverlight controls...

Justin
0
Justin
Top achievements
Rank 1
answered on 01 Aug 2011, 08:27 PM
OK, I have figured out to make this work using the sample provided in this forum thread (http://www.telerik.com/community/forums/silverlight/calendar/radcalender-control-problem.aspx).  However, all I am doing here right now is setting the visibility of the textblock to "Collapsed"

Since this still draws a border around the box, and the hover state can still be activated, I am wondering how I can hide the whole cell.  Just not sure which property in the DataTemplate I could use to make this work.  :)

Thanks!

Justin
0
Konstantina
Telerik team
answered on 04 Aug 2011, 03:57 PM
Hi Justin,

I am afraid you cannot remove the cells completely, because the columns with the buttons are put in an UniformGrid and even thought they are not there, there still will be saved place for them.

Best wishes,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Justin
Top achievements
Rank 1
answered on 04 Aug 2011, 07:13 PM
Is it possible to disable selection and hover states?  The calendar is for viewing purposes only, and users will not be clicking on indivudal dates at all.  Really only being used to show the dates of any given month, and events are listed in a grid below.

I have tried to edit templates and styles for the calendar, and just not being successful in getting rid of the styling for hover and selected states..

Thoughts?

Justin
0
Konstantina
Telerik team
answered on 05 Aug 2011, 01:48 PM
Hello Justin,

The date buttons are represented by a ButtonChrome control, so in order to remove the hover states you will need to edit its template. You can find more information about the customization of this control in this KB article - it is for WPF, but the logic is the same and in Silverlight instead if Triggers, we use VisualStates.
You can customize the control very easy in Expression Blend. Just drop a RadCalendar control in the design surface, right-click it and choose from the menu Edit Additional Templates-> Edit DayButtonStyle. After that find the SelectionChrome control (this is the ButtonChrome mentioned before), right click it and choose from the menu Edit Template-> Edit a Copy. Blend will generate all the needed resources. Find the VisualStates for the hover and remove them.

Hope this helps.

Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Justin
Top achievements
Rank 1
answered on 06 Aug 2011, 12:44 AM
Thanks - that provided some help.  :)

Slightly different question...

I want to be able to display multiple selected dates - but for some reason the only time that the calendar will display the selected date the way I am looking for is when the DisplayDate is set.  Which will only show a single date.

Any idea how to address this?  Or am I missing something else?

Justin
0
Konstantina
Telerik team
answered on 09 Aug 2011, 02:00 PM
Hello Justin,

I suggest you to set the appropriate SelectionMode in order to be able to select multiple dates. This is illustrated in this online demo. You can also find some more information about this property in this help article.

Kind regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>
0
Justin
Top achievements
Rank 1
answered on 18 Aug 2011, 07:19 PM
Konstantina - I have done all that.  If I set a single data as Display Date - the selection shows up just as I want.  If I add dates to SelectedDates I get nothing...

Justin
0
Justin
Top achievements
Rank 1
answered on 19 Aug 2011, 10:22 PM
Resolved - once again due to operator error.  Sigh.  :)

Apparently I had made a mistake somewhere in editing the template for the DayButton, and the dates WERE being selected, just not changing color.  Only the "focused" date was showing up correctly.

Changed template, all good now.

(Still having issue with displaydatestart and end though - which is in a different thread)

Justin
0
Konstantina
Telerik team
answered on 22 Aug 2011, 03:13 PM
Hi Justin,

We are glad that the issue is resolved.

Please let us know if you have any other concerns about our controls.

Regards,
Konstantina
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Calendar
Asked by
Arash Emami
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Justin
Top achievements
Rank 1
Share this question
or