Passing selected tab index via radbutton client side function

2 posts, 0 answers
  1. PALAK
    PALAK avatar
    1 posts
    Member since:
    Sep 2016

    Posted 16 Sep Link to this post



    I am trying to pass selected index via client side function with below code 

    <telerik:RadButton ID="btnDeliverySetting" ClientIDMode="Static" OnClientClicking="function(button,args){getRadTabStrip('<%=NotificationsWizardTS.SelectedIndex%>','<%=NotificationTypesTS.SelectedIndex%>');}" runat="server" Text="Continue" ButtonType="StandardButton"  CssClass="btn_Normal">


    and at client side my function is as under 


    function getRadTabStrip(NotificationsWizardTSIndex, NotificationTypesTSIndex) {
            alert("Wizard" + NotificationsWizardTSIndex);
            alert("Type" + NotificationTypesTSIndex);



    This is alerting just string "Wizard<%=NotificationsWizardTS.SelectedIndex%>" and "Type<%=NotificationsTypeTS.SelectedIndex%>"


    How can i pass indexof both selected tabs?

  2. Anton
    Anton avatar
    58 posts

    Posted 19 Sep Link to this post

    Hello Palak,

    get_selectedIndexes() gives you an array of all selected tabs. You can check on the example below:

    <telerik:RadScriptManager runat="server"></telerik:RadScriptManager>
                <telerik:RadTabStrip RenderMode="Lightweight" ID="RadTabStrip1" runat="server">
                                <telerik:RadTab runat="server" Text="Child Tab 1" />
                                <telerik:RadTab runat="server" Text="Child Tab 2" />
                                <telerik:RadTab runat="server" Text="Child Tab 3" />
                                <telerik:RadTab runat="server" Text="Child Tab 4" />
                                <telerik:RadTab runat="server" Text="Child Tab 5" Selected="True" />
                        <telerik:RadTab runat="server" Text="Tab2" />
                        <telerik:RadTab runat="server" Text="Tab3" />
                <telerik:RadButton ID="btnDeliverySetting" AutoPostBack="false" ClientIDMode="Static" OnClientClicking="onClientClicking" runat="server" Text="Continue" ButtonType="StandardButton" CssClass="btn_Normal">
                function onClientClicking(sender, args) {
                    var tabStrip = $find("<%= RadTabStrip1.ClientID %>"),
                        indexesOfSelectedTabs = tabStrip.get_selectedIndexes();

    Telerik by Progress
    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top