Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Expander > IsExpanded = false doesn´t work in ViewModel

Not answered IsExpanded = false doesn´t work in ViewModel

Feed from this thread
  • Nelson avatar

    Posted on Aug 16, 2011 (permalink)

    Hi there,

    I use in my application one RadExpander and what I want is, in my viewModel, change the state of Expander. I want when the user clicks in a button put the RadExpander with IsExpanded property to false, but doesn´t work.

    I did this in my viewModel:

     public void radExpanderAnexo_Expanded(object sender, Telerik.Windows.RadRoutedEventArgs e)
     {
                if (sender != null)
                    AnexosExpander = (RadExpander)e.Source;
      }

    And when I click in a button I want do that:

    private void OnClosed(object sender, WindowClosedEventArgs e)
     {
                if (e.DialogResult == true)
                {
                    AnexosExpander.IsExpanded = false;
                }
     }

    Any help please?

    Thanks in advance.

    Reply

  • Petar Mladenov Petar Mladenov admin's avatar

    Posted on Aug 18, 2011 (permalink)

    Hello Nelson,

     I can see a code-behind (not ViewModel's code) in your snippets. If you need code behind solution, you can check out the attached project where the ViewModel`s property is changed dynamically ( you can also change the IsExpanded of the RadExpander). If you need ViewModel's code you can use Commands. Please let us know if you need further assistance on this.

    Regards,
    Petar Mladenov
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

    Attached files

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / Silverlight > Expander > IsExpanded = false doesn´t work in ViewModel
Related resources for "IsExpanded = false doesn´t work in ViewModel"

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