Articles in this section

How to display more looping items in the TimeSelector of WPF TimePicker (SfTimePicker)?

The number of LoopingSelectorItems (which are displayed in the Looping Selector) is based on the height of the each looping item and the available height of the SfTimeSelector of WPF TimePicker (SfTimePicker). By default, the height of the sSelector and the looping item are set to 300 and 30 respectively, sohence the number of LoopingSelectorItemthe displayed LoopingSelectorItem is 8. Based on the required number of LoopingSelectorItems, youwe should change the height of the sSelector. The following code demonstrates the same.

Mainwindow.xaml:

<Grid>
  <Grid.ColumnDefinitions>
    <ColumnDefinition />
    <ColumnDefinition/>
  </Grid.ColumnDefinitions>
  <syncfusion:SfTimeSelector x:Name="TimeSelector"                                                                     
                                    AccentBrush="Black" 
                                    Background="Transparent"
                                    Header="" 
                                    BorderBrush="Transparent"
                                    BorderThickness="2" 
                                    ShowCancelButton="False"
                                    ShowDoneButton="False" />
  </Grid>

 

Mainwindow.cs

public partial class MainWindow : Window
{
  public MainWindow()
  {
    InitializeComponent();
    this.SizeChanged += MainWindow_SizeChanged;
  }
  private void MainWindow_SizeChanged(object sender, SizeChangedEventArgs e)
  {
    if(this.ActualHeight != 0)
    {
      TimeSelector.Height = this.ActualHeight;
    }
  }
}

 

 

WPF SfTimeSelector height change

View sample in GitHub.

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Access denied
Access denied