How can I remove the borders inside RadDatePicker
in WPF?
I mean these grey vertical and horizontal lines inside RadCalendar
.
How can I remove the borders inside RadDatePicker
in WPF?
I mean these grey vertical and horizontal lines inside RadCalendar
.
In order to change the visual appearance of controls, you have to change their default style or control templates. If you have installed Telerik UI for WPF you can find the default styles for controls here:
From your screenshot I guess that you are using the Fluent theme. The resources for the
RadDatePicker
can be found in\Fluent\Themes\Telerik.Windows.Controls.Input.xaml
.What you describe in your screenshot as a border is actually the background of the calendar control. It only appears to be a border, because the buttons within the calendar have a margin that makes the background visible.
As you can see below, the
LayoutRoot
Grid
defines a margin in the control template ofCalendarButton
.In order to remove the margin, copy the
CalendarButtonStyle
style and remove theMargin
in it.Then create a style a
RadCalendar
style that uses thisCalendarButton
style.Then create a
RadDatePicker
style that uses thisRadCalendar
style.Now you can apply this style to any date picker like this.
If you want this style to be applied to all
RadDatePicker
s in scope, you can add an implicit style.This is a screenshot of the resulting calendar.
For more information on styling the
RadDatePicker
, you can refer to the documentation.