This is a migrated thread and some comments may be shown as answers.

How To remove a perticula tab during page loading

3 Answers 64 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Sagar Baheti
Top achievements
Rank 1
Sagar Baheti asked on 28 May 2008, 12:16 PM
Hi ,
I have tabs on master page, and now depend upon user privileges i want to remove some tabs when page get load.  How can i do that..?

Regards,
Sagar

3 Answers, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 28 May 2008, 12:21 PM
Hi Sagar,

You can easily achieve your goal using the Visible property of the tab.

 protected void Page_Load(object sender, EventArgs e)  
{  
    RadTab myTab = (RadTab)RadTabStrip1.FindTabByText("Root RadTab2");  
    myTab.Visible = false;  

Best wishes,
Paul
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Sagar Baheti
Top achievements
Rank 1
answered on 28 May 2008, 12:33 PM

Hi Paul,

Thanks for quick reply. Now tab is removed but  when i click on tab it will showing error as
"Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index"

0
Sagar Baheti
Top achievements
Rank 1
answered on 28 May 2008, 01:04 PM
Hey i my problem is solved by following code

   RadTab removeTab = RadTabStrip1.FindTabByText("Application Central");
        if (removeTab != null)
        {
            RadTabStrip1.Tabs.Remove(removeTab);
        }
Tags
TabStrip
Asked by
Sagar Baheti
Top achievements
Rank 1
Answers by
Paul
Telerik team
Sagar Baheti
Top achievements
Rank 1
Share this question
or