Disabling TabItems?

2 posts, 0 answers
  1. Nathi Mfeka
    Nathi Mfeka avatar
    16 posts
    Member since:
    Aug 2009

    Posted 06 Oct 2009 Link to this post

    Hi

    I'm trying to disable two tabs on my tabcontrol,  this (

    (

    this.TabControl.SelectedItem as RadTabItem).IsEnabled = false;) disables the first one, in the same manner is there a method I can use to disable the other two instead? I did have a look at your FirstLook, but the thing is here we customised your RadTabControl and Items not that much was done we just added a header and some buttons below the tabs. hense tab item are added using this code: 

     

     

     

    <pt:TabEditor.Items>

     

     

     

    <localControls:Details x:Name="personalInfo"/>

     

     

     

     

     

     

    <localControls:TaskListView x:Name="publicInfo"/>

     

     

     

     

     

     

    <localControls:Relations x:Name="releventInfo"/>

     

     

     

     

     

     

    </pt:TabEditor.Items>

    Thanks for your assistance
    Nathi

     

  2. Nathi Mfeka
    Nathi Mfeka avatar
    16 posts
    Member since:
    Aug 2009

    Posted 07 Oct 2009 Link to this post

    Hi

    Please ignore my previous post, after hours of trial and error, the on thing I had to do was:
     

     #region Disable Tabs  
                    if(this.TabControl.Items.ElementAt(1) != null)  
                    {  
                        (this.TabControl.Items.ElementAt(1) as RadTabItem).IsEnabled = false;  
                    }  
                    if(this.TabControl.Items.ElementAt(2) != null)  
                    {  
                        (this.TabControl.Items.ElementAt(2) as RadTabItem).IsEnabled = false;  
                    }
     #endregion 

    the problem is I'm new with silverlight and telerik, I didnt know what the .ElementAt() does.

    But thanks anyways, I know you wouldhave given me good directions.

    Kind Regards
  3. DevCraft banner
Back to Top