RadDocking border

0 Answers 16 Views
Docking
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Deltaohm asked on 16 Apr 2024, 10:21 AM | edited on 18 Apr 2024, 07:02 AM

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

 

Stenly
Telerik team
commented on 19 Apr 2024, 08:08 AM

Could you share, which theme is used and what is the version of the assemblies on your end? This will allow me to check the version of the theme using the version of the DLLs that is used on your side.
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 19 Apr 2024, 08:27 AM

Thank you Stenly
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
Stenly
Telerik team
commented on 22 Apr 2024, 10:05 AM

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.

Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
commented on 23 Apr 2024, 03:12 PM

Yes,

Your code works great.

Thank you

Luigi

No answers yet. Maybe you can help?

Tags
Docking
Asked by
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Share this question
or