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

Setting the weekday format in Scheduler month view

6 Answers 253 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Grant
Top achievements
Rank 1
Grant asked on 26 Jun 2015, 12:01 AM

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.

6 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 30 Jun 2015, 11:15 AM
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
0
Grant
Top achievements
Rank 1
answered on 30 Jun 2015, 02:17 PM

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);
}
}

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 03 Jul 2015, 08:21 AM
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
0
Fahmi
Top achievements
Rank 1
Veteran
answered on 16 Jan 2021, 11:04 AM

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

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 18 Jan 2021, 12:57 PM
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/.

0
Fahmi
Top achievements
Rank 1
Veteran
answered on 21 Jan 2021, 08:32 PM

Hi Dess,

Thank you, this worked perfectly.

Best regards,

Fahmi

Tags
Scheduler and Reminder
Asked by
Grant
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Grant
Top achievements
Rank 1
Fahmi
Top achievements
Rank 1
Veteran
Share this question
or