Setting the weekday format in Scheduler month view

7 posts, 0 answers
  1. Grant
    Grant avatar
    9 posts
    Member since:
    Apr 2015

    Posted 25 Jun 2015 Link to this post

    I am not able to set the weekday format in Scheduler for month view. I am using the control in a very small area, and I need to set the weekday names to be abbreviated (Mon, Tue, Wed, etc.).

    I have set the HeaderFormat property on both the GetMonthView() and the scheduler control, and it does not seem to change. I still see the weekday names fully spelled out, and Wednesday will not fit into the allocated area.

  2. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4130 posts

    Posted 30 Jun 2015 Link to this post

    Hello Grant,

    Thank you for writing.

    In order to achieve your goal, it is suitable to use the CellFormatting event and assign the desired string to the respective header cells:
    public Form1()
    {
        InitializeComponent();
        this.radScheduler1.CellFormatting+=radScheduler1_CellFormatting;
        this.radScheduler1.ActiveViewType = Telerik.WinControls.UI.SchedulerViewType.Month;
         
    }
     
    private void radScheduler1_CellFormatting(object sender, Telerik.WinControls.UI.SchedulerCellEventArgs e)
    {
        SchedulerHeaderCellElement headerCell = e.CellElement as SchedulerHeaderCellElement;
        if (headerCell!=null)
        {
            string pattern = headerCell.Date.DayOfWeek.ToString().Substring(0, 3);
            if (headerCell.Text.Length!=pattern.Length&&headerCell.Text.StartsWith(pattern))
            {
                headerCell.Text = pattern;
            }
        }
    }

    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. Grant
    Grant avatar
    9 posts
    Member since:
    Apr 2015

    Posted 30 Jun 2015 in reply to Dess | Tech Support Engineer, Sr. Link to this post

    This didn't quite work for me, but it set me on the right track. My header cells don't seem to have a valid Date property. All of them seem to be 1/1/1980, which happens to be a Tuesday, so Tuesday gets set correctly to Tue. I am not using a navigator, I don't know if this makes a difference.

    Anyhow, your basic idea did work with a slight modification:

    private void rsReserve_CellFormatting(object sender, SchedulerCellEventArgs e)
    {
    SchedulerHeaderCellElement headerCell = e.CellElement as SchedulerHeaderCellElement;
    if (headerCell != null && headerCell.Text.EndsWith("day"))
    {
    headerCell.Text = headerCell.Text.Substring(0, 3);
    }
    }

     

  4. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4130 posts

    Posted 03 Jul 2015 Link to this post

    Hello Grant,

    Thank you for writing back.

    I have attached my sample project as well. Feel free to use this approach which suits your requirement best.

    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
  5. Fahmi
    Fahmi avatar
    9 posts
    Member since:
    May 2016

    Posted 16 Jan Link to this post

    Hi,

    The datasource that I bind to the scheduler contains hours for example 2021-01-16 14:00 to 2021-01-17 12:00

    but when I bind it to the scheduler, both the 16th and 17th are filled.
    How can I have only half of 16th and 17th filled rather all days.

    Thanks

  6. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    4130 posts

    Posted 18 Jan Link to this post

    Hello, Fahmi, 

    RadScheduler supports functionality to arrange appointments according to their start time and duration. The EnableExactTimeRendering property allows you to control whether the appointment start and end time should be rendered exactly. By default its value is false. Feel free to set it to true and thus the appointment is expected to occupy only the respective time interval: https://docs.telerik.com/devtools/winforms/controls/scheduler/views/exact-time-rendering  

    Please have in mind that due to the great difference in the amount of time, which different time scales represent, appointments might become too small to render accurately in larger time scales.

    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

    Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

  7. Fahmi
    Fahmi avatar
    9 posts
    Member since:
    May 2016

    Posted 21 Jan in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Hi Dess,

    Thank you, this worked perfectly.

    Best regards,

    Fahmi

Back to Top