IsHidden Problem in RadPane with binding

6 posts, 0 answers
  1. Ravi
    Ravi avatar
    97 posts
    Member since:
    Jun 2012

    Posted 16 Apr 2013 Link to this post

    Hi There,

    I have a problem with RadPanes isHidden property, i want to set IsHidden by using a binding, but when i do this it is not working, but if i set the IsHidden="True" at XAML then its working properly, can you please guide me in this case ?

    Thanks in advance,
  2. Ivo
    Ivo avatar
    390 posts

    Posted 18 Apr 2013 Link to this post

    Hi Srinivas,

    When a RadPane is hidden it is moved out of the visual tree so its DataContext is set to null. When the DataContext is set to null the IsHidden binding is lost and you cannot show it again. However if you explicitly set the DataContext of the RadPane it will not be lost and everything will work as expected. here is sample code:

        <local:ViewModel x:Key="ViewModel" />
    <Grid DataContext="{Binding Source={StaticResource ViewModel}}">
            <RowDefinition Height="22" />
            <RowDefinition />
        <CheckBox Content="Is Hidden" IsChecked="{Binding IsHidden, Mode=TwoWay}" />
        <telerik:RadDocking Grid.Row="1">
                    <telerik:RadPane Header="Pane 1" DataContext="{StaticResource ViewModel}" IsHidden="{Binding IsHidden, Mode=TwoWay}" />

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Robert
    Robert avatar
    271 posts
    Member since:
    Mar 2011

    Posted 18 Oct 2013 Link to this post

    Well this answers why I am unable to locate my pane using the following method when the IsHidden property is set.

    CustomerOrderDetailsPane customerOrderDetailsPane = this.FindChildByType<CustomerOrderDetailsPane>();

    Can you recommend a way to hide a pane but still allow it to be searchable?

    Would collapsing the visibility setting work better?

    Many thanks,

  4. George
    George avatar
    1332 posts

    Posted 22 Oct 2013 Link to this post

    Hello Rob,

    You could set the x:Name of the Pane and use it in the code-behind as well. Hope this helps.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. John
    John avatar
    22 posts
    Member since:
    Aug 2014

    Posted 26 Oct 2016 in reply to Ivo Link to this post

    Only direct binding works? Because the setter in the style(<Setter Property="IsHidden" Value="True" />) is not being applied:
    <t:RadPane HorizontalAlignment="Left" CanUserClose="False" Title="Gates" DataContext="{Binding Active, Source={gui:SubApplicationSelectorRetreiver}}"
            <Style TargetType="t:RadPane" BasedOn="{StaticResource MyPaneStyle}">
                <Setter Property="IsHidden" Value="True" />
                    <DataTrigger Binding="{Binding Converter={StaticResource typeof}}" Value="{x:Type local:MDVDesignerAdapter}">
                        <Setter Property="IsHidden" Value="False" />
                <local:MDVToolbox />
  6. Nasko
    Nasko avatar
    643 posts

    Posted 28 Oct 2016 Link to this post

    Hello John,

    The observed by you behavior is an expected one when DataTriggers are used. When the Pane is visualized (IsHidden is True) the property takes precedence over the the DataTrigger - you could no longer change its value through the Trigger.

    We suggest you to consider using direct binding for the IsHidden property instead of using Triggers to change its value.

    Hope the provided information will be helpful for you.

    Telerik by Progress
    Do you need help with upgrading your WPF project? Try the Telerik API Analyzer and share your thoughts!
Back to Top