+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Custom RadTabStrip - SelectedCssClass

Custom RadTabStrip - SelectedCssClass

10 posts, 0 answered
  1. Darren
    Darren avatar
    15 posts
    Registered:
    06 Oct 2010
    04 Jan 2011
    Link to this post
    Hi

    I have created a custom RadTabStrip that needs to have different css classes on each tab. Following the website I dragged the RadTabStrip control onto my masterpage and then edited it using the Smart tag. Each of my tabs now show a different css class, however I cannot get the SelectedCssClass to work. According to documentation on "Setting the CSS Class" you can remove the skin by inserting Skin="" and then use the SelectedCssClass to give the selected tab a class. Here is the code I have used:

    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" Skin="">
        <Tabs>
            <telerik:RadTab runat="server" CssClass="link1"
                NavigateUrl="/page01.aspx" Owner="RadTabStrip1"
                Text="Page 01" SelectedCssClass="current">
            </telerik:RadTab>
            <telerik:RadTab runat="server" CssClass="link2"
                NavigateUrl="/page02.aspx" Owner="RadTabStrip1"
                Text="Page 02" SelectedCssClass="current">
            </telerik:RadTab>
            <telerik:RadTab runat="server" CssClass="link3"
                NavigateUrl="/page03.aspx" Owner="RadTabStrip1"
                Text="Page 03" SelectedCssClass="current">
            </telerik:RadTab>
            <telerik:RadTab runat="server" CssClass="link4"
                NavigateUrl="/page04.aspx" Owner="RadTabStrip1"
                Text="Page 04" SelectedCssClass="current">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>

    Does anyone know of a reason why the SelectedCssClass isn't working?

    Thanks
  2. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Jan 2011
    Link to this post
    Hi Darren,

    Thank you for using our services.

    Can you please let us know how you are telling your RadTabStrip which item is selected?

    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. Darren
    Darren avatar
    15 posts
    Registered:
    06 Oct 2010
    05 Jan 2011
    Link to this post
    Hi Radoslav

    I'm new to this and not a developer. How do I tell the RadTabStrip which is selected as I haven't done this? Is there a tutorial or example I can follow?

    Thanks
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    05 Jan 2011
    Link to this post
    Hi Darren,

    You can find live examples and tutorials for all RadControls for ASP.NET Ajax on our demo site. You can see how an items is set as selected here: TabStrip / Custom CSS Classes. Also you can find the online documentation of the RadTabstrip here.

    All the best,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Darren
    Darren avatar
    15 posts
    Registered:
    06 Oct 2010
    05 Jan 2011
    Link to this post
    The demos and documents aren't really explaining this to me very well. What do I need to add to tell the RadTabStrip what is selected? I presume there must be more than just adding the RadTabStrip to the page from the toolbox and then using the Smart Tag. This was what was originally recommended for me to do and it works great for the hover effects. I just can't get the Selected class to apply and I'm at a total loss as to what I am missing.

    Thanks
  6. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    06 Jan 2011
    Link to this post
    Hello Darren,

    Each RadTab item has a property called Selected. Then this property is set to true the tab strip applies the selected class to the item.

    Greetings,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Darren
    Darren avatar
    15 posts
    Registered:
    06 Oct 2010
    06 Jan 2011
    Link to this post
    Hi Radolsav

    I see this option in the RadTab item property. What I am finding is I click on the first item in my RadTabStrip and set the selected property to true. Then when I go to the second item in my RadTab and set that to true it resets my first item back to false.

    I have 4 items in my RadTabStrip. How would I get each item to inherit the true property when selected if it is only allowing me to have it selected on one?

    Thanks
  8. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    11 Jan 2011
    Link to this post
    Hi Darren,

    The tab strip can support one selected item at a time. If you wish your tabs to have a specific look you should just provide the rules for the tabs, not for selected tab.

    Kind regards,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  9. Darren
    Darren avatar
    15 posts
    Registered:
    06 Oct 2010
    11 Jan 2011
    Link to this post
    Hi Radoslav

    How do I provide the rules for the tabs? Is this done in the Smart Tag or is this another file within Sitefinity. Could you please guide me as this is the first time I have used this software and I am a designer trying to get my head around the controls.

    Thanks for your help.
  10. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    11 Jan 2011
    Link to this post
    Hi Darren,

    Each item has a CssClass property which sets a general CSS class for the item. You can also visit this KB article which explains how to control appearance of the RadControls for ASP.NET Ajax.

    All the best,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
10 posts, 0 answered