Hi
I change a grid with a raddocking in order to allow resizing of space between my two controls.
It woks well but there is a border around pane that I don't want because is not nice inside the context (I highlight it in yellow):
Here the piece of xaml:
<t:RadDocking
Grid.Row="1" Grid.Column="1"
HasDocumentHost="False"
BorderThickness="0">
<t:RadSplitContainer
InitialPosition="DockedRight"
Visibility="{Binding ComandiGrafici.PercentiliGridVisibility,
Converter={StaticResource BoolToVis}}"
BorderThickness="0">
<t:RadPaneGroup>
<t:RadPane
BorderThickness="0"
PaneHeaderVisibility="Collapsed">
<local:PercentiliControl
Margin="0, 0, 5, 0"/>
</t:RadPane>
</t:RadPaneGroup>
</t:RadSplitContainer>
<t:RadSplitContainer
InitialPosition="DockedLeft"
BorderThickness="0">
<t:RadPaneGroup
BorderThickness="0">
<t:RadPane
PaneHeaderVisibility="Collapsed"
BorderThickness="0">
<WpfPlot
Loaded="WpfPlot_Loaded"
Background="Azure"
AxesChanged="WpfPlot_AxesChanged" AllowDrop="True"
MouseMove="WpfPlot_MouseMove"
MouseDoubleClick="_wpfPlot_MouseDoubleClick"
Visibility="{Binding IsGraphicView, Converter={StaticResource BoolToVis}}"
t:RadContextMenu.ContextMenu="{StaticResource PlotContextMenu}"/>
</t:RadPane>
</t:RadPaneGroup>
</t:RadSplitContainer>
</t:RadDocking>
Note that by default the border is double, I hide one setting BorderThickness="0" in RadDocking tag.
Can I hide the second border?
Thank you
Luigi
I'm using the Windows8 theme and telerik wpf version 2023.03.1114.70 (I haven't problem to upgrade telerik version if necessary).
Luigi
Hello Luigi,
This border is present in the default control template of the RadPaneGroup element and is represented by a Rectangle element. Its StrokeThickness property is set to "1" explicitly.
To hide it, would be to retrieve this Rectangle via the ChildrenOfType extension method and set its StrokeThickness property to 0. This can be done via an attached property.
The following code snippet shows the implementation of the above suggestion:
public class RadPaneGroupExtensions { public static bool GetShouldChangeThicknessOfRectangle(DependencyObject obj) { return (bool)obj.GetValue(ShouldChangeThicknessOfRectangleProperty); } public static void SetShouldChangeThicknessOfRectangle(DependencyObject obj, bool value) { obj.SetValue(ShouldChangeThicknessOfRectangleProperty, value); } public static readonly DependencyProperty ShouldChangeThicknessOfRectangleProperty = DependencyProperty.RegisterAttached("ShouldChangeThicknessOfRectangle", typeof(bool), typeof(RadPaneGroupExtensions), new PropertyMetadata(false, OnShouldChangeThicknessOfRectangleChanged)); private static void OnShouldChangeThicknessOfRectangleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { if ((bool)e.NewValue) { RadPaneGroup radPaneGroup = (RadPaneGroup)d; radPaneGroup.Loaded += RadPaneGroup_Loaded; } } private static void RadPaneGroup_Loaded(object sender, RoutedEventArgs e) { RadPaneGroup radPaneGroup = (RadPaneGroup)sender; Rectangle rectangle = radPaneGroup.ChildrenOfType<Rectangle>().FirstOrDefault(); if (rectangle != null) { rectangle.StrokeThickness = 0; } } }
<telerik:RadPaneGroup local:RadPaneGroupExtensions.ShouldChangeThicknessOfRectangle="True">
The produced result will be as follows:
I hope the provided information will be of help to you.
Yes,
Your code works great.
Thank you
Luigi