This is a migrated thread and some comments may be shown as answers.
Disabling TabItems?
1 Answer 22 Views
This is a migrated thread and some comments may be shown as answers.
Nathi Mfeka
Top achievements
Rank 2
Nathi Mfeka asked on 06 Oct 2009, 01:48 PM
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

 

1 Answer, 1 is accepted

Sort by
0
Nathi Mfeka
Top achievements
Rank 2
answered on 07 Oct 2009, 12:31 PM

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
Asked by
Nathi Mfeka
Top achievements
Rank 2
Answers by
Nathi Mfeka
Top achievements
Rank 2
Share this question
or