Beispiel #1
0
 private void OnTimeFieldPrepared(object sender, Syncfusion.UI.Xaml.Editors.DateTimeFieldPreparedEventArgs e)
 {
     if (e.Column.Field == DateTimeField.Minute || e.Column.Field == DateTimeField.Second)
     {
         e.Column.ItemsSource = GetMinutesOrSeconds(e.Column.Format);
     }
 }
 /// <summary>
 /// Helps to set the custom format and ItemTemplate for day column using DateFieldPrepared event of <see cref="DateTimeSpinnerBase"/>.
 /// </summary>
 private void OnDateFieldPrepared(object sender, Syncfusion.UI.Xaml.Editors.DateTimeFieldPreparedEventArgs e)
 {
     if (e.Column != null && e.Column.Field == Syncfusion.UI.Xaml.Editors.DateTimeField.Day)
     {
         e.Column.Format       = "ddd dd";
         e.Column.ItemTemplate = this.Resources["CustomFormatTemplate"] as DataTemplate;
     }
 }
        /// <summary>
        /// Helps to update the ItemsSource of Day column by excluding weekend days using DateFieldPrepared event of <see cref="DateTimeSpinnerBase"/>.
        /// </summary>
        private void ExcludeWeekEndDatesOnDateFieldPrepared(object sender, Syncfusion.UI.Xaml.Editors.DateTimeFieldPreparedEventArgs e)
        {
            var spinnerBase = sender as DateTimeSpinnerBase;

            if (e.Column != null && spinnerBase.SelectedDateTime != null && e.Column.Field == Syncfusion.UI.Xaml.Editors.DateTimeField.Day)
            {
                e.Column.Format      = "ddd dd";
                e.Column.ItemsSource = this.RemoveWeekendItems(spinnerBase.SelectedDateTime, e.Column);
            }
        }