Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Expander > Expand Collapse containing window

Not answered Expand Collapse containing window

Feed from this thread
  • Xaria D avatar

    Posted on Aug 10, 2010 (permalink)

    I have a Rad Expander inside a RadPane.
    I wish to expand or resize the width of the pane when the expander is expanded and likewise, reduce the width when expander is collapsed.
    How to get the desired behavior?

    Reply

  • Xaria D avatar

    Posted on Aug 10, 2010 (permalink)

    Bump.

    Reply

  • Miroslav Miroslav admin's avatar

    Posted on Aug 13, 2010 (permalink)

    Hi Xaria D,

    Is it a floating / undocked pane?

    Then you can use this code:

    static MainWindow()
    {
        EventManager.RegisterClassHandler(typeof(RadPane), 
            RadExpander.CollapsedEvent, new RoutedEventHandler(OnExpanderToggled));
        EventManager.RegisterClassHandler(typeof(RadPane), 
            RadExpander.ExpandedEvent, new RoutedEventHandler(OnExpanderToggled));
    }
      
    private static void OnExpanderToggled(object sender, RoutedEventArgs e)
    {
        var pane = sender as RadPane;
        var window = pane.GetVisualParent<ToolWindow>();
      
        if (window != null
            && (pane.IsFloating || pane.IsFloatingOnly))
        {
            window.ClearValue(Control.HeightProperty);
        }
    }

    Whenever an expander in the content is toggled, the height would size to the desired size of the content.

    Regards,
    Miroslav
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / WPF > Expander > Expand Collapse containing window
Related resources for "Expand Collapse containing window"

WPF Expander Features  |  Documentation  |  Demos  |  Telerik TV  |  Self-Paced Trainer  ]