Skip to content

Latest commit

 

History

History
62 lines (50 loc) · 1.89 KB

kb-calendar-hide-moveleft-moveright-buttons.md

File metadata and controls

62 lines (50 loc) · 1.89 KB
title description type page_title slug position tags ticketid res_type
How to Hide the Forward and Backward Buttons in RadCalendar
Controlling the visibility of the previous and next buttons in RadCalendar.
how-to
Change the Visibility of the Move Left and Move Right Buttons in the Calendar Header
kb-calendar-hide-moveleft-moveright-buttons
0
loaded,childrenoftype,repeatbutton,visual,tree,helper
1407259
kb

Environment

Product Version 2017.3.1018
Product RadCalendar for WPF

Description

How to hide the forward and backward buttons in RadCalendar.

Solution 1

  1. Subscribe to the Loaded event of RadCalendar.
  2. Use the ChildrenOfType<T> extension method to get the RepeatButton controls representing the move-left and move-right buttons. The ChildrenOfType<T> method is defined in the Telerik.Windows.Controls.ChildrenOfTypeExtensions class.

[C#]

{{region kb-calendar-hide-moveleft-moveright-buttons-0}} private void RadCalendar_Loaded(object sender, RoutedEventArgs e) { var calendar = (RadCalendar)sender; var moveLeftButton = calendar.ChildrenOfType().FirstOrDefault(x => x.Name == "MoveLeft"); var moveRightButton = calendar.ChildrenOfType().FirstOrDefault(x => x.Name == "MoveRight");

	moveLeftButton.Visibility = Visibility.Collapsed;
	moveRightButton.Visibility = Visibility.Collapsed;
}

{{endregion}}

Solution 2

After R3 2019, you can use the PreviousButtonVisibility and NextButtonVisibility properties of the RadCalendar.

[XAML]

{{region kb-calendar-hide-moveleft-moveright-buttons-1}} <telerik:RadCalendar NextButtonVisibility="Hidden"/> {{endregion}}

See Also

  • [Visual Tree Helpers]({%slug common-visual-tree-helpers%})