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

SelectedTabIndex on Page Load

1 Answer 32 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Ewald
Top achievements
Rank 1
Ewald asked on 17 Sep 2011, 05:44 PM
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?

1 Answer, 1 is accepted

Sort by
0
Kate
Telerik team
answered on 22 Sep 2011, 10:28 AM
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">
                    <Items>
                        <telerik:RibbonBarButton  Size="Medium" Text="button1" ImageUrl="../images/Failed.png" />
                    </Items>
                </telerik:RibbonBarGroup>
            </telerik:RibbonBarTab>
                <telerik:RibbonBarTab Text="tab2">
                <telerik:RibbonBarGroup Text="group2">
                    <Items>
                        <telerik:RibbonBarButton  Size="Medium" Text="button2" ImageUrl="../images/Failed.png" />
                    </Items>
                </telerik:RibbonBarGroup>
            </telerik:RibbonBarTab>
        </telerik:RadRibbonBar>
        <br />
        <telerik:RadButton ID="RadButton1" runat="server" Text="RadButton">
        </telerik:RadButton>

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

Regards,
Kate
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
Tags
RibbonBar
Asked by
Ewald
Top achievements
Rank 1
Answers by
Kate
Telerik team
Share this question
or