We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How can I change the format of the date display header item in the scheduler week view to the format I want?

Thread ID:

Created:

Updated:

Platform:

Replies:

145363 Jun 19,2019 04:35 AM UTC Jun 20,2019 07:17 AM UTC WinForms 3
loading
Tags: ScheduleControl
Smart law developer
Asked On June 19, 2019 04:39 AM UTC

How can I change the format of the date display header item in the scheduler week view to the format I want?
No customization of date display header items in weekly view;

"SchedulerControl.Appearance.WeekMonthFullFormat" property.
"MMM d, yy" to "yyyy-mm-dd"
We need an example that converts "MMM d, yy" to "yyyy-mm-dd" for localizing("ko-KR") One more.
We need an example that converts date format 'mm, yyyy' to 'yyyy-mm' in SchedulerControl calendar navigator; Thank you.

Jagadeesan Pichaimuthu [Syncfusion]
Replied On June 19, 2019 12:13 PM UTC

Hi Smart, 
  
Thanks for contacting Syncfusion support. 
  
Query 
Response 
How can I change the format of the date display header item in the scheduler week view to the format I want?
No customization of date display header items in weekly view;
 
We suspect that you are using Metro theme appearance for Schedule control. If yes means, you could implement the following code to achieve your reported scenario. Please refer the following code example and the sample. 
  
C# 
scheduleControl1.Appearance.VisualStyle = Syncfusion.Windows.Forms.GridVisualStyles.Metro; 
this.scheduleControl1.ScheduleGridCreated += ScheduleControl1_ScheduleGridCreated; 
this.scheduleControl1.Appearance.WeekMonthFullFormat = "yyyy-mm-dd"; 
private voidScheduleControl1_ScheduleGridCreated(object sender,ScheduleGridCreatedEventArgs e) 
{ 
    if (e.Schedule.ScheduleType ==ScheduleViewType.Week) 
    { 
        e.Grid = new ScheduleGrid(e.Schedule.Calendar, e.Schedule, e.InitialDate); 
        e.Schedule.Appearance.WeekMonthFullFormat ="yyyy-MM-dd"; 
        e.Handled = true; 
    } 
} 
We need an example that converts date format 'mm, yyyy' to 'yyyy-mm' in SchedulerControl calendar navigator; 
To change the date format for calendar navigator, you could the QueryCellInfo event. Please refer the following code example. 
  
C# 
this.scheduleControl1.Calendar.CalenderGrid.QueryCellInfo += CalenderGrid_QueryCellInfo; 
private voidScheduleControl1_ScheduleGridCreated(object sender,ScheduleGridCreatedEventArgs e) 
{ 
    if (e.Schedule.ScheduleType ==ScheduleViewType.Week) 
    { 
        e.Grid = new ScheduleGrid(e.Schedule.Calendar, e.Schedule, e.InitialDate); 
        e.Schedule.Appearance.WeekMonthFullFormat ="yyyy-MM-dd"; 
        e.Handled = true; 
    } 
} 
  
  
Please get back to us if you need any further assistance on this. 
  
Regards, 
Jagadeesan 


Smart law developer
Replied On June 19, 2019 05:16 PM UTC

Thanks to Jagadeesan Pichaimuthu [Syncfusion].
I was able to solve it perfectly with the sample source you created.
Thank you.

Write down some of the code for other developers.         int rowsPerCol = 8;
        private void CalenderGrid_QueryCellInfo(object sender, Syncfusion.Windows.Forms.Grid.GridQueryCellInfoEventArgs e)
        {
            if (e.ColIndex == 1 && e.RowIndex % rowsPerCol == 0)
            {
                int cal = e.RowIndex / rowsPerCol;
                DateTime dt = this.scheduleControl1.Calendar.DateValue.AddMonths(cal);
                dt = dt.AddDays(-dt.Day + 1);
                e.Style.Text = dt.ToString("yyyy-MMMM", this.scheduleControl1.Calendar.CalenderGrid.TableStyle.CultureInfo);
            }
        }

Jagadeesan Pichaimuthu [Syncfusion]
Replied On June 20, 2019 07:17 AM UTC

Hi Smart, 
 
Thanks for your update. 
 
We are glad to know that the provided solution worked at your end. Please let us know if you have any further queries on this. We are happy to help you. 
 
Regards, 
Jagadeesan 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon