Redraw/refresh RadCalendar?

48 posts, 0 answers
  1. Ben Lischner
    Ben Lischner avatar
    1 posts
    Member since:
    Dec 2009

    Posted 11 Jan 2010 Link to this post

    I'm wondering if there's an easy way to get the RadCalendar to re-render itself. I'm using a custom DayTemplateSelector to modify the appearance of dates, but the data that drives the appearance of the dates is not static. I need the ability to have the Calendar redraw so that it can re-calcuate its appearance when I update the underlying data that drives the formatting.
  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 14 Jan 2010 Link to this post

    Hi Ben Lischner,

    We have a lot of requests for the scenario you are asking about. Unfortunately there is no way to accomplish it. We are working on resolving this issue and we will provide a fix in one of the nearest releases of our controls.

    Kind regards,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. DevCraft banner
  4. Albert Holt
    Albert Holt avatar
    1 posts
    Member since:
    Nov 2009

    Posted 26 Jan 2010 Link to this post

    I am having the same issue.  Tried things like changing the current month and changing it back, but that doesn't work either - only if the user does this through the gui.  Can't understand why there isn't a simple rebind or refresh function?
  5. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 29 Jan 2010 Link to this post

    Hello Albert Holt,

    We are aware of the limitation related to this scenario. We are planning to remove the limitation in the Q2 2010 official release. Please accept our apologies if we have caused you any troubles.


    Regards,
    Kaloyan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  6. Ken
    Ken avatar
    104 posts
    Member since:
    Aug 2010

    Posted 31 Aug 2010 Link to this post

    Any news?
  7. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 02 Sep 2010 Link to this post

    Hello Adrian,

    Please accept our deep apologies. We didn't manage to fix the issue as we were developing some more major tasks during the Q2 time frame. Be sure that the task is in our priority list and will be completed very soon in the near future.

    All the best,
    Kaloyan
    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
  8. AlinRaul
    AlinRaul avatar
    10 posts
    Member since:
    Jul 2009

    Posted 04 Oct 2010 Link to this post

    Hello there,

    Do you have an ETA on this? Thanks.
  9. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 07 Oct 2010 Link to this post

    Hi AlinRaul,

    We can't  take on an exact estimation of the fix. We will try for the following Q3 release. Please accept our apologies.

    Best wishes,
    Kaloyan
    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
  10. Ken
    Ken avatar
    104 posts
    Member since:
    Aug 2010

    Posted 25 Oct 2010 Link to this post

    Any news guys?
  11. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 27 Oct 2010 Link to this post

    Hi Adrian,

    The task is logged in our TFS with a proper priority.

    Sincerely yours,
    Kaloyan
    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
  12. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 27 Oct 2010 Link to this post

    Hi Adrian,


    Sincerely yours,
    Kaloyan
    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
  13. Michael
    Michael avatar
    4 posts
    Member since:
    Oct 2010

    Posted 03 Nov 2010 Link to this post

    I have exactly the same problem.
    Please let me know when a fix is in place.

    Thank you.
  14. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 09 Nov 2010 Link to this post

    Hello Michael,

    You will be notified when a fix is provided.

    All the best,
    Kaloyan
    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
  15. Adam
    Adam avatar
    32 posts
    Member since:
    Sep 2010

    Posted 10 Dec 2010 Link to this post

    Was this fixed in the Q3 release? If not, has anybody implemented a work around? In our case it is the style selector that needs refreshing.
  16. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 11 Dec 2010 Link to this post

    Hi Adam,

    We are currently working on the problem resolving.

    Best wishes,
    Kaloyan
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  17. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 14 Dec 2010 Link to this post

    Hello Everyone,

    Just want to let you know that this issue is now Fixed and will be available in the next LIB (latest internal build).

    All the best,
    Hristo
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  18. Forest
    Forest avatar
    72 posts
    Member since:
    Aug 2010

    Posted 15 Dec 2010 Link to this post

    Hello

    Do the RadControls_for_Silverlight_4_2010_3_1213_TRIAL_hotfix.zip fix this problem ?

    Thank you very much.

    Mathieu
  19. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 15 Dec 2010 Link to this post

    Hi Forest,

    Yes RadControls_for_Silverlight_4_2010_3_1213_TRIAL_hotfix should contain this fix.

    Greetings,
    Hristo
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  20. Jeff
    Jeff avatar
    5 posts
    Member since:
    Nov 2010

    Posted 15 Dec 2010 Link to this post

    If this is fixed, then what is the solution to redraw the Day Buttons?

    Are you positive that RadControls_for_Silverlight_4_2010_3_1213_TRIAL_hotfix contains this fix?  The release notes detail no changes to the RadCalendar control at all.
  21. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 15 Dec 2010 Link to this post

    Hi Jeff,

    There is one note that I should mention - there are few properties DayTemplate, DayTemplateSelector, DayButtonStyle and DayButtonStyleSelector. If you set DayTemplate then changes to DayTemplateSelector will not affect the containers. The same goes for DayButtonStyle. As a rule Selectors are applied only if not selectors properties (DayTemplate and DayButtonStyle in this case) are null.

    In our themes we have set both DayTemplate and DayButtonStyle properties so changing the selectors will not update the UI. The easiest solution is to set both properties to {x:Null} in XAML and then selector properties will be used and changing them will update the UI.

    Also if you want to apply the same template/style the you could just change DayTemplate or DayButtonStyle properties (without using Selector properties at all).

    Here is a link to our online help:
    http://www.telerik.com/help/silverlight/radcalendar-editing-button.html

    Let us know if you need more information.

    Greetings,
    Hristo
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  22. Jeff
    Jeff avatar
    5 posts
    Member since:
    Nov 2010

    Posted 15 Dec 2010 Link to this post

    Ok, I under that I must not use both Selectors and selector properties.

    I am dynamically updating my custom DayTemplateSelector's Collection from the RadCalendar control itself with days that contain an event.

    I've followed the First Look example in the Demo solution.

    Here is my XAML code.

    <CollectionViewSource x:Key="AvailabilityView" x:Name="AvailabilityList" Filter="AvailabilityList_Filter" Source="{Binding collectionAvailabilityRecords}" />
         
        <Tyler:AvailabilityCollection x:Key="AvailabilityCollection">
        </Tyler:AvailabilityCollection>
         
        <Tyler:AvailabilityDayTemplateSelector x:Key="AvailablityDayTemplateSelector" x:Name="AvailDayTempSel" AvailabilityCollection="{StaticResource AvailabilityCollection}">

    <CollectionViewSource x:Key="AvailabilityView" x:Name="AvailabilityList" Filter="AvailabilityList_Filter" Source="{Binding collectionAvailabilityRecords}" />
        
        <Tyler:AvailabilityCollection x:Key="AvailabilityCollection">
        </Tyler:AvailabilityCollection>
        
        <Tyler:AvailabilityDayTemplateSelector x:Key="AvailablityDayTemplateSelector" x:Name="AvailDayTempSel" AvailabilityCollection="{StaticResource AvailabilityCollection}">

    Since these DayTemplateSelectors can only be bound to StaticResources, I've created an empty collection to assign to the DayTemplateSelector.

    Then in my calling UserControl code behind, I'm accessing the DayTemplate collection directly on the RadCalendar control and adding dates to that collection from my WCF service results.


    private void radCalendar1_refreshEventDays()
    {     
      ((OfficerScheduling.AvailabilityDayTemplateSelector)(radCalendar1.DayTemplateSelector)).AvailabilityCollection.Clear();
      foreach (Availability a in ((CalendarView) this.DataContext).collectionAvailabilityRecords)
      {
        ((OfficerScheduling.AvailabilityDayTemplateSelector)(radCalendar1.DayTemplateSelector)).AvailabilityCollection.Add(a);
      }
    }

    Whenever a user makes a change to affect the records being used in the DayTemplate Selector class, the WCF service is called again. In its AsyncCallback, it populates the DataConext.collectionAvailabilityRecords and then calls the radCalendar1_refreshEventDays() function above.

    Perhaps I'm not doing things correctly, but it works when the calendar is initially populated and displayed. So, how does this new update to the RadControl help in updating the display when the backing collection of the DayTemplateSelector changes?
  23. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 16 Dec 2010 Link to this post

    Hi Jeff,

    I'm not sure that I understand your case. Could you please open a support ticket and attach a project demonstrating the problem? This way it will be much easier for me to help you.

    Kind regards,
    Hristo
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  24. Jeff
    Jeff avatar
    5 posts
    Member since:
    Nov 2010

    Posted 16 Dec 2010 Link to this post

    Ok, I will do so, but I am pretty much doing exactly what everyone else in this thread is doing.

    I am using custom DayTemplateSelector class that is being controlled by a collection of dates.

    Your demo project uses a static collection, while everyone else here is using a dynamically populated collection.

    When new dates are added or removed to this collection, I and everyone else in this thread would like to see the DayTemplates that are being controlled by the DayTemplateSelector class updated when we change the collection of dates for that class.

    For example, on the initial draw of RadCalendar, my collection on the DayTemplateSelector are dates A, B, C.  The dates A, B, C are drawn with the special template highlighted in green. The user performs an action on the page that includes the RadCalendar that causes date D to be added to the collection of dates.

    Therefore, they would expect to see dates A, B, C, and now D highlighted in green.  But, the calendar doesn't draw this "D" date as green unless the user clicks the forward button away from the date range, and navigates back.  Doing this causes the RadCalendar to redraw the dates and now we see the A, B, C, and D dates as green.  Everyone here is asking for a way to either have the calendar redraw automatically on modification of the DayTemplateSelector's collection or force a redraw of the days without user interaction.

    If there was a "solution" to this problem, how do you force the redraw, or how do you setup the collection for the RadCalendar to notice the change in items?
  25. Hristo
    Admin
    Hristo avatar
    832 posts

    Posted 17 Dec 2010 Link to this post

    Hi Jeff,

    I think I understand your case. You have custom DayTemplateSelector and at some point you are adding new DataTemplate to a collection in this custom DayTemplateSelector, right?

    RadCalendar is not listening for a collection or property change in DataTemplateSelector class (or its inheritors). That is why updating this collection does not redraw RadCalendar. We did not design RadCalendar to support this scenario.

    What we fixed was that updating DayTemplate, DayTemplateSelector, DayButtonStyle and DayButtonStyleSelector after calendar is loaded will redraw the calendar. In your case if you update your collection and then set DayTemplateSelector to null and then to the same selector will redraw the calendar.

    I hope this helps.

    Regards,
    Hristo
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  26. Jeff
    Jeff avatar
    5 posts
    Member since:
    Nov 2010

    Posted 17 Dec 2010 Link to this post

    Excellent!  This bit of detail is just what I needed.  The calendar is redrawing with all dates. 

    Thanks for finally providing this functionality! 
  27. Forest
    Forest avatar
    72 posts
    Member since:
    Aug 2010

    Posted 21 Dec 2010 Link to this post

    Hi

    Can you provide us a sample project please ?

    Thank you

    Mathieu
  28. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 27 Dec 2010 Link to this post

    Hello Ben Lischner,

    Find the attached application with the recommended approach.

    All the best,
    Kaloyan
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  29. Forest
    Forest avatar
    72 posts
    Member since:
    Aug 2010

    Posted 29 Dec 2010 Link to this post

    Hello

    Thank you very much. It works.

    Mathieu
  30. Nick
    Nick avatar
    1 posts
    Member since:
    Aug 2010

    Posted 11 Feb 2011 Link to this post

    I have tried the attached sample project and when clicking the Add Date button the calendar does not redraw.  The custom day button style selector code is never hit.  I have the same issue as everyone else in that I need to update the dates being displayed based on a dynamic collection.  There doesn't seem to be a way to do this in the Silverlight version of this control.  Can you please test this sample app against the latest build?

    Thanks
  31. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 16 Feb 2011 Link to this post

    Hi Nick,

    I can confirm that the feature is working with the latest build.

    Regards,
    Kaloyan
    the Telerik team
    Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Back to Top
DevCraft banner