How to hide days outside of the current month?

12 posts, 0 answers
  1. Arash Emami
    Arash Emami avatar
    6 posts
    Member since:
    Mar 2010

    Posted 22 Mar 2010 Link to this post

    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
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 25 Mar 2010 Link to this post

    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.
  3. DevCraft banner
  4. Justin
    Justin avatar
    35 posts
    Member since:
    Apr 2008

    Posted 01 Aug 2011 Link to this post

    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
  5. Justin
    Justin avatar
    35 posts
    Member since:
    Apr 2008

    Posted 01 Aug 2011 Link to this post

    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
  6. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 04 Aug 2011 Link to this post

    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 >>
  7. Justin
    Justin avatar
    35 posts
    Member since:
    Apr 2008

    Posted 04 Aug 2011 Link to this post

    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
  8. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 05 Aug 2011 Link to this post

    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 >>
  9. Justin
    Justin avatar
    35 posts
    Member since:
    Apr 2008

    Posted 05 Aug 2011 Link to this post

    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
  10. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 09 Aug 2011 Link to this post

    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 >>
  11. Justin
    Justin avatar
    35 posts
    Member since:
    Apr 2008

    Posted 18 Aug 2011 Link to this post

    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
  12. Justin
    Justin avatar
    35 posts
    Member since:
    Apr 2008

    Posted 19 Aug 2011 Link to this post

    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
  13. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 22 Aug 2011 Link to this post

    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 >>

Back to Top
DevCraft banner