Bug: RadTreeView cannot be enabled once it's been disabled

12 posts, 1 answers
  1. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 01 Dec 2008 Link to this post

    Once IsEnabled has been set to false, it cannot be enabled again. Here's an example:

    <UserControl x:Class="SilverlightApplication4.Page3" 
                 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
                 xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.GridView" 
                 xmlns:teleriknav="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation" 
                 xmlns:telerikbase="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" 
                 Width="400" 
                 Height="300"
        <Grid x:Name="LayoutRoot" 
              Background="White"
            <StackPanel> 
                <teleriknav:RadTreeView x:Name="RadTreeView1"
                    <teleriknav:RadTreeView.Items> 
                         
                        <teleriknav:RadTreeViewItem Header="node 1"
                            <teleriknav:RadTreeViewItem.Items> 
                                <teleriknav:RadTreeViewItem Header="node 1 - 1"></teleriknav:RadTreeViewItem> 
                                <teleriknav:RadTreeViewItem Header="node 1 - 2"></teleriknav:RadTreeViewItem> 
                            </teleriknav:RadTreeViewItem.Items> 
                        </teleriknav:RadTreeViewItem> 
                         
                        <teleriknav:RadTreeViewItem Header="node 2"
                            <teleriknav:RadTreeViewItem.Items> 
                                <teleriknav:RadTreeViewItem Header="node 2 - 1"></teleriknav:RadTreeViewItem> 
                                <teleriknav:RadTreeViewItem Header="node 2 - 2"></teleriknav:RadTreeViewItem> 
                            </teleriknav:RadTreeViewItem.Items> 
                        </teleriknav:RadTreeViewItem> 
                    </teleriknav:RadTreeView.Items> 
                </teleriknav:RadTreeView> 
                 
                <Button Content="toggle" Click="Button_Click"></Button> 
            </StackPanel> 
        </Grid> 
    </UserControl> 
     

    And the code-behind:
    using System; 
    using System.Collections.Generic; 
    using System.Linq; 
    using System.Net; 
    using System.Windows; 
    using System.Windows.Controls; 
    using System.Windows.Documents; 
    using System.Windows.Input; 
    using System.Windows.Media; 
    using System.Windows.Media.Animation; 
    using System.Windows.Shapes; 
     
    namespace SilverlightApplication4 
        public partial class Page3 : UserControl 
        { 
            public Page3() 
            { 
                InitializeComponent(); 
            } 
     
            private void Button_Click(object sender, RoutedEventArgs e) 
            { 
                RadTreeView1.IsEnabled = !RadTreeView1.IsEnabled; 
            } 
        } 
     

  2. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 02 Dec 2008 Link to this post

    Hi Henrik,

    I was able to reproduce and fix the bug. The fix will be available in the upcoming SP2 of RadControls for Silverlight after a couple of weeks. If you need it earlier, open a support ticket and I will send you a custom build.

    All the best,
    Valeri Hristov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. DevCraft banner
  4. hwsoderlund
    hwsoderlund avatar
    419 posts
    Member since:
    Aug 2006

    Posted 02 Dec 2008 Link to this post

    No worries, I'll wait for the next release.
  5. Christian
    Christian avatar
    15 posts
    Member since:
    Apr 2009

    Posted 01 Sep 2009 Link to this post

    Hi Folks,

    I'm working on a silverlight 2.0 project and have been using the 2009.1.526.1020 version of the "RadControls for Silverlight" up until now. Today I added two methods to my main user control which set all child user controls of this control to disabled/enabled:

    internal

     

    void OpenPopUp(string headerText, PopUpContent popUpContent)

     

    {

     

    this.PopUpContent = popUpContent;

     

     

    this.PopUpHeader = headerText;

     

     

    this.basePopUp.Visibility = Visibility.Visible;

     

     

    this.ucNavigation.IsEnabled = false;

     

     

    this.ucProperties.IsEnabled = false;

     

     

    this.ucRollupGeneral.IsEnabled = false;

     

     

    this.ucTerritories.IsEnabled = false;

     

     

    }

     


    internal
    void ClosePopUp()

     

    {

     

    this.ucNavigation.IsEnabled = true;

     

     

    this.ucProperties.IsEnabled = true;

     

     

    this.ucRollupGeneral.IsEnabled = true;

     

     

    this.ucTerritories.IsEnabled = true;

     

     

    this.basePopUp.Visibility = Visibility.Collapsed;

     

    }


    The child user control called ucNavigation uses a RadTreeView to display data. Disabling the RadTreeView works like a charm, but if I set the parent control back to IsEnabled = true, the RadTreeView remains partly disabled. By partly I mean, that it remains disabled for mouse input but not for keyboard input and it is stuck in the "Disabled" visual state.

    After reading this tread, I updated to
    the 2009.2.701.1020 version of the "RadControls for Silverlight" and I'm still experiencing this phenomenon. What am I doing wrong?
    Could somebody please enlighten me?

    Christian
  6. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 01 Sep 2009 Link to this post

    Hello Christian,

    This is fixed in the latest build of RadControls - 0812. Please note that this is a SL3 build.

    Regards,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. Christian
    Christian avatar
    15 posts
    Member since:
    Apr 2009

    Posted 01 Sep 2009 Link to this post

    Hi Valentin,

    Thanks for your quick answer. The support here really is topnotch.
    Unfortunately I'm stuck with Silverlight 2.0 and it is not for me to decide whether I can migrate to silverlight 3.0.
    On the other hand: I've been nagging my boss for quite some time now about updating and this gives me more ammunition.

    Yours,
    Christian
  8. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 01 Sep 2009 Link to this post

    Hi Christian,

    Yes - afer the Q2.SP1 release we moved all our new developments to SL3. I can say that almost all of our users are also using SL3 now.

    Silverlight is a fast moving platform currently and it is recommended to use the latest framework while developing your application.

    All the best,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Christian
    Christian avatar
    15 posts
    Member since:
    Apr 2009

    Posted 02 Sep 2009 Link to this post

    Hi Valentin,

    Yeah, I know. Do tell this to the decision makers in my project. ;)
    That's what I keeping saying over and over again.

    Yours,
    Christian
  10. Christian
    Christian avatar
    15 posts
    Member since:
    Apr 2009

    Posted 25 Sep 2009 Link to this post

    Hi,
    I was finally able to upgrade our project to Silverlight 3 and we are now using the RadControls version 2009.2.812.1030. The problem is, I still have trouble with the RadTreeView. If I disable a user control on which a RadTreeView was placed, the tree view control is disabled too. So far so good. But if I set the user control back to enabled, the RadTreeView control will still be disabled. What I am doing wrong?

    Christian
  11. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 25 Sep 2009 Link to this post

    Hi Christian,

    What version of the controls are you using? We are not aware of this issue with the latest binaries.

    Greetings,
    Valentin.Stoychev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  12. Christian
    Christian avatar
    15 posts
    Member since:
    Apr 2009

    Posted 25 Sep 2009 Link to this post

    Hi Valentin,

    Thanks for your quick reply. As I wrote above, we are using version 2009.2.812.1030.

    Yours,
    Christian
  13. Christian
    Christian avatar
    15 posts
    Member since:
    Apr 2009

    Posted 25 Sep 2009 Link to this post

    You are right, Valentin. The 2009.2.812.1030 version of the RadTreeView DOES work correctly. We are using an application-wide theme, which was made by a design company and this causes the issue. If I disable the theming for the trees, they will work just fine. I guess, now I have to investigate in this direction.

Back to Top
DevCraft banner