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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

MonthCalendar FirstDayOfWeek

Thread ID:

Created:

Updated:

Platform:

Replies:

47257 Aug 1,2006 12:22 AM UTC Aug 1,2006 01:30 AM UTC WinForms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On August 1, 2006 12:22 AM UTC


Does anyone know how to set the first day of the week to Monday instead of Sunday for a MonthCalendar in a grid control. I''ve tried the code before with no success.

Thanks,
Todd

this.gbcDate.MappingName = "AirDate";
this.gbcDate.StyleInfo.CellType = "MonthCalendar";
this.gbcDate.StyleInfo.CellValueType = typeof(System.DateTime);

System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("en-US");
cultureInfo.DateTimeFormat.FirstDayOfWeek = DayOfWeek.Monday;

this.gbcDate.StyleInfo.CultureInfo = cultureInfo;
this.gbcDate.StyleInfo.Format = "d";

Administrator [Syncfusion]
Replied On August 1, 2006 01:30 AM UTC


OK, got it. Sorry.
-Todd

private void dgAiringTime_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
GridDropDownMonthCalendarCellRenderer cr = this.dgAiringTime.CurrentCell.Renderer as GridDropDownMonthCalendarCellRenderer;

if (cr != null)
{
MonthCalendar calendar = cr.DropDownContainer.Controls[0] as MonthCalendar;

calendar.FirstDayOfWeek = Day.Monday;
}
}

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

;