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. Image for the cookie policy date

MonthCalendar FirstDayOfWeek


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";

1 Reply

AD Administrator Syncfusion Team 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;
}
}

Loader.
Live Chat Icon For mobile
Up arrow icon