public UCYearMonthRangeSelector() { InitializeComponent(); if (!DesignMode) { List <Year> listYears = GetYearRange(); DSCommon.BindImageComboBox(cmbBeginYear, listYears, x => true, "description", "year"); DSCommon.BindImageComboBox(cmbEndYear, listYears, y => true, "description", "year"); List <Month> listMonths = GetMonthRange(); DSCommon.BindImageComboBox(cmbBeginMonth, listMonths, m => true, "description", "month"); DSCommon.BindImageComboBox(cmbEndMonth, listMonths, m => true, "description", "month"); BeginDate = DateTimeHelper.DefaultDateTime; EndDate = DateTime.Now; } }
protected override void OnFirstLoad() { base.OnFirstLoad(); if (!DesignMode) { List <Year> listYears = UCYearMonthRangeSelector.GetYearRange(ShowMoreDate ? DateTime.Now.Year + 50 : 0); DSCommon.BindImageComboBox(cmbBeginYear, listYears, x => true, "description", "year"); List <Month> listMonths = UCYearMonthRangeSelector.GetMonthRange(); DSCommon.BindImageComboBox(cmbBeginMonth, listMonths, m => true, "description", "month"); if (DefaultTime != default(DateTime)) { DateTime = DefaultTime; } else { DateTime = DateTime.Now; } } }
private void FillYear() { List <Year> listYears = UCYearMonthRangeSelector.GetYearRange(_maxYear, _minYear); DSCommon.BindImageComboBox(cmbYear, listYears, x => true, "description", "year"); }