Articles in this section
Category / Section

How to disable Up and Down Buttons in TimeSpanEdit?

1 min read

In TimeSpanEdit, disable the Up and Down buttons by fetching them from the TimeSpanEdit control template by using their name, upbutton and downbutton for UpButton and DownButton of the control respectively.

XAML

<syncfusion:TimeSpanEdit x:Name="timespan"  Loaded="timespan_Loaded_1" HorizontalAlignment="Center" VerticalAlignment="Center" Height="30" Width="100">
</syncfusion:TimeSpanEdit>

C#

private void timespan_Loaded_1(object sender, RoutedEventArgs e)
{
(timespan.Template.FindName("upbutton", timespan) as RepeatButton).IsEnabled = false;
(timespan.Template.FindName("downbutton", timespan) as RepeatButton).IsEnabled = false;
}

The following screenshot displays the Up and Down buttons as disabled state in TimeSpanEdit,

Figure 1: Up and Down buttons in disabled state

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