Disable TimeZone on RadSchedulerNavigator

7 posts, 1 answers
  1. Dario
    Dario avatar
    61 posts
    Member since:
    Apr 2011

    Posted 19 Jun 2015 Link to this post

    Hi guys,

    I would disable a ComboBox that shows all TimeZones, I would set local time and prohibit to change it.

    How can I do?

    I attached print screen

  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 22 Jun 2015 Link to this post

    Hello Dario,

    Thank you for writing.

    You can hide the TimeZones option in RadSchedulerNavigator by setting the SchedulerNavigatorElement.TimeZonesDropDown.Visibility:
    this.radSchedulerNavigator1.SchedulerNavigatorElement.TimeZonesDropDown.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;

    I hope this information helps. Should you have further questions, I would be glad to help.
     
    Regards,
    Dess
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Dario
    Dario avatar
    61 posts
    Member since:
    Apr 2011

    Posted 22 Jun 2015 in reply to Dess Link to this post

    Ok, but how can I set local time?
  5. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 22 Jun 2015 Link to this post

    Hello Dario,

    Thank you for writing back.

    You can refer to our Demo application >> Scheduler >> Time Zones example. Additionally, the Time Zones help article is quite useful on this topic.

    I hope this information helps. If you have any additional questions, please let me know.
     
    Regards,
    Dess
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
  6. Dario
    Dario avatar
    61 posts
    Member since:
    Apr 2011

    Posted 22 Jun 2015 in reply to Dess Link to this post

    I have already read the article, but when I set my TimeZone in this mode, when I view the Scheduler with SchedulerNavigator appears (in the dropdown) always UTC, my configuration has no effect. Why?

    SchedulerTimeZone utcTimeZone = new SchedulerTimeZone(59, "UTC +1");
    this.radScheduler1.SystemTimeZone = utcTimeZone;

  7. Dario
    Dario avatar
    61 posts
    Member since:
    Apr 2011

    Posted 22 Jun 2015 in reply to Dario Link to this post

    I forgot, I read http://www.telerik.com/help/winforms/scheduler-views-time-zones.html, but in related video I'm not found nothing video tutorial about Scheduler and TimeZone.
  8. Answer
    Dess
    Admin
    Dess avatar
    1609 posts

    Posted 23 Jun 2015 Link to this post

    Hello Dario,

    Thank you for writing back.

    You should set the DefaultTimeZone property instead. However, the SchedulerNavigatorElement.TimeZonesDropDown is bound to the returned collection by the SchedulerTimeZone.GetSchedulerTimeZones() method. When you create a new SchedulerTimeZone, note that this is not present in the SchedulerNavigatorElement.TimeZonesDropDown.DataSource. Hence, the SchedulerNavigatorElement.TimeZonesDropDown.SelectedValue property will not be changed when the AssociatedScheduler.ActiveView.DefaultTimeZone is changed to your new time zone. I would recommend you to iterate the result collection from the SchedulerTimeZone.GetSchedulerTimeZones() method and find the desired time zone. Then, assign it to RadScheduler.DefaultTimeZone property. Thus, the navigator will be updated.
    private void Form1_Load(object sender, EventArgs e)
    {
        this.radSchedulerNavigator1.AssociatedScheduler = this.radScheduler1;
        SchedulerTimeZone londonTimeZone = GetSpecificTimeZone("London", "London");
        this.radScheduler1.ActiveView.DefaultTimeZone = londonTimeZone;
    }
     
    private SchedulerTimeZone GetSpecificTimeZone(string timeZoneLabel, string schedulerLabel)
    {
        foreach (SchedulerTimeZone tz in SchedulerTimeZone.GetSchedulerTimeZones())
        {
            if (tz.Label.Contains(timeZoneLabel))
            {
                tz.Label = schedulerLabel;
                return tz;
            }
        }
     
        return null;
    }

    While working on your case, I have encountered a problem and logged it in our feedback portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item.

    I have also updated your Telerik points.

    As to the video about the TimeZones in RadScheduler, I would like to note that currently we are migrating all videos to http://www.telerik.com/videos/winforms and the process is not over yet. 

    I hope this information helps. If you have any additional questions, please let me know.
     
    Regards,
    Dess
    Telerik
    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 Feedback Portal and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready