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 |
Product Version | 2017.3.1018 |
Product | RadCalendar for WPF |
How to hide the forward and backward buttons in RadCalendar.
- 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.
{{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}}
After R3 2019, you can use the PreviousButtonVisibility and NextButtonVisibility properties of the RadCalendar.
{{region kb-calendar-hide-moveleft-moveright-buttons-1}} <telerik:RadCalendar NextButtonVisibility="Hidden"/> {{endregion}}
- [Visual Tree Helpers]({%slug common-visual-tree-helpers%})