How To remove a perticula tab during page loading

4 posts, 0 answers
  1. Sagar Baheti
    Sagar Baheti avatar
    28 posts
    Member since:
    May 2008

    Posted 28 May 2008 Link to this post

    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
  2. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 28 May 2008 Link to this post

    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
  3. Sagar Baheti
    Sagar Baheti avatar
    28 posts
    Member since:
    May 2008

    Posted 28 May 2008 Link to this post

    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"

  4. Sagar Baheti
    Sagar Baheti avatar
    28 posts
    Member since:
    May 2008

    Posted 28 May 2008 Link to this post

    Hey i my problem is solved by following code

       RadTab removeTab = RadTabStrip1.FindTabByText("Application Central");
            if (removeTab != null)
            {
                RadTabStrip1.Tabs.Remove(removeTab);
            }
Back to Top