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.
Unfortunately, activation email could not send to your email. Please try again.

MonthCalendar FirstDayOfWeek

Thread ID:

Created:

Updated:

Platform:

Replies:

47257 Jul 31,2006 08:22 PM Jul 31,2006 09:30 PM Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On July 31, 2006 08:22 PM


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 July 31, 2006 09:30 PM


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.

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.

;