change the sekected tabs in radstrip

2 posts, 0 answers
  1. beeta one
    beeta one avatar
    63 posts
    Member since:
    Aug 2012

    Posted 17 Dec 2012 Link to this post

    I want to change the selected tabs in radtabstrip in every 5s. How can i achieve that? 
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 17 Dec 2012 Link to this post

    Hi,

    I suppose you want to rotate between the selected RadTabs. Try the following code snippet to achieve your scenario.

    ASPX:
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" MultiPageID="RadMultiPage1" OnClientLoad="OnClientLoad" SelectedIndex="0">
        <Tabs>
            <telerik:RadTab runat="server" Text="RadTab1" Selected="True">
            </telerik:RadTab>
            ..............
        </Tabs>
    </telerik:RadTabStrip>

    JS:
    <script type="text/javascript">
        function OnClientLoad(sender, args) {
            intervalID = setInterval(function () {
                var tabstrip = $find("<%= RadTabStrip1.ClientID %>");
                var i = tabstrip.get_selectedIndex();
                if (i < 3) {
                    tabstrip.set_selectedIndex(i + 1);
                }
                else {
                    tabstrip.set_selectedIndex(0);
                }
            }, 5000);
        }
    </script>

    Regards,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top