How to Hide the Forward and Backward Buttons in RadCalendar
Environment
Product Version | 2017.3.1018 |
Product | RadCalendar for WPF |
Description
How to hide the forward and backward buttons in RadCalendar.
Solution 1
- Subscribe to the
Loaded
event of RadCalendar. - Use the
ChildrenOfType<T>
extension method to get the RepeatButton controls representing the move-left and move-right buttons. TheChildrenOfType<T>
method is defined in theTelerik.Windows.Controls.ChildrenOfTypeExtensions
class.
private void RadCalendar_Loaded(object sender, RoutedEventArgs e)
{
var calendar = (RadCalendar)sender;
var moveLeftButton = calendar.ChildrenOfType<RepeatButton>().FirstOrDefault(x => x.Name == "MoveLeft");
var moveRightButton = calendar.ChildrenOfType<RepeatButton>().FirstOrDefault(x => x.Name == "MoveRight");
moveLeftButton.Visibility = Visibility.Collapsed;
moveRightButton.Visibility = Visibility.Collapsed;
}
Solution 2
After R3 2019, you can use the PreviousButtonVisibility and NextButtonVisibility properties of the RadCalendar.
<Grid>
<telerik:RadCalendar NextButtonVisibility="Hidden"/>
</Grid>