SelectedTabIndex on Page Load

2 posts, 0 answers
  1. Ewald
    Ewald avatar
    11 posts
    Member since:
    Mar 2011

    Posted 17 Sep 2011 Link to this post

    When I set the SelectedTabIndex on Page Load it does only work the first time the page is loaded. On the following postbacks it is not correctly handled.
    However, if I add the same logic in the OnPreRender, it works correctly.

    Is this by design? or is it a bug?
  2. Kate
    Kate avatar
    1898 posts

    Posted 22 Sep 2011 Link to this post

    Hello Ewald,

    I tested the issue that you describe using the code below and when I set SelectedTabIndex = 1 and have a button that makes a postback on the page, every time the page postback tab2 is rendered as selected. Please give it a try and let me know if you still encounter this issue. If so, could you clarify the exact version of the controls that you are using?
    <telerik:RadRibbonBar ID="RadRibbonBar1"  runat="server">
                <telerik:RibbonBarTab Text="tab1">
                    <telerik:RibbonBarGroup Text="group1">
                            <telerik:RibbonBarButton  Size="Medium" Text="button1" ImageUrl="../images/Failed.png" />
                    <telerik:RibbonBarTab Text="tab2">
                    <telerik:RibbonBarGroup Text="group2">
                            <telerik:RibbonBarButton  Size="Medium" Text="button2" ImageUrl="../images/Failed.png" />
            <br />
            <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton">

    code behind:
    protected void Page_Load(object sender, EventArgs e)
        RadRibbonBar1.SelectedTabIndex = 1;

    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top