Cannot get selected tab

4 posts, 1 answers
  1. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 16 Nov 2010 Link to this post

    I have a tabstrip whose name is highlighted below. When I try and get the selected tab I'm on, the value comes back null. I know I am on a tab, because that is where the data entry is taking place. The selectedTab variable is supposed to be coming back with a value.

    What am I doing wrong?

    html
    ------------
    <telerik:RadTabStrip ID="tsCoding" runat="server" Align="Left" MultiPageID="RadMultiPage1"
                                                                                        OnClientTabSelected="tsCoding_OnClientTabSelected" AutoPostBack="false" CausesValidation="false"
                                                                                        ScrollButtonsPosition="Right" BackColor="Gray">

    <Tabs>
                                                                                            <telerik:RadTab Text="<u>C</u>hart" AccessKey="C" PageViewID="pvChart">
                                                                                            </telerik:RadTab>
                                                                                            <telerik:RadTab runat="server" id="tbEMTool" Text="E/M <u>T</u>ool" AccessKey="T"
                                                                                                PageViewID="pvTreatMent" Enabled="false">
                                                                                                <Tabs>
                                                                                                    <telerik:RadTab Text="Treatme<u>n</u>t" AccessKey="N" PageViewID="pvTreatMent" Enabled="false">
                                                                                                    </telerik:RadTab>
                                                                                                    <telerik:RadTab Text="Comple<u>x</u>ity" AccessKey="X" PageViewID="pvComplexity"
                                                                                                        Enabled="false">
                                                                                                    </telerik:RadTab>
                                                                                                    <telerik:RadTab Text="<u>R</u>esult" AccessKey="R" PageViewID="pvResult" Enabled="false">
                                                                                                    </telerik:RadTab>
                                                                                                    <telerik:RadTab Text="<u>H</u>istory" AccessKey="H" PageViewID="pvHistory" Enabled="false">
                                                                                                    </telerik:RadTab>
                                                                                                    <telerik:RadTab Text="<u>E</u>xam" AccessKey="E" PageViewID="pvExam" Enabled="false">
                                                                                                    </telerik:RadTab>
                                                                                                    <telerik:RadTab Text="<u>S</u>ummary" AccessKey="S" PageViewID="pvSummary" Enabled="false">
                                                                                                    </telerik:RadTab>
                                                                                                </Tabs>
                                                                                            </telerik:RadTab>
                                                                                            <telerik:RadTab Text="P<u>Q</u>RI" AccessKey="Q" id="tbPQRI" Enabled="false">
                                                                                                <Tabs>
                                                                                                    <telerik:RadTab Text="<u>A</u>cute MI" AccessKey="A" PageViewID="pvAcuteMI" Enabled="false">
                                                                                                    </telerik:RadTab>
                                                                                                    <telerik:RadTab Text="Chest <u>P</u>ain" AccessKey="P" PageViewID="pvChestPain" Enabled="false">
                                                                                                    </telerik:RadTab>
                                                                                                    <telerik:RadTab Text="S<u>y</u>ncope" AccessKey="Y" PageViewID="pvSyncopy" Enabled="false">
                                                                                                    </telerik:RadTab>
                                                                                                    <telerik:RadTab Text="Pne<u>u</u>monia" AccessKey="U" PageViewID="pvPneumonia" Enabled="false">
                                                                                                    </telerik:RadTab>
                                                                                                </Tabs>
                                                                                            </telerik:RadTab>
                                                                                        </Tabs>
                                                                                    </telerik:RadTabStrip>


    js
    --

     

    var tsCoding = $find("<%= tsCoding.ClientID %>");

     

     

    var selectedTab = tsCoding.get_selectedTab();

     

     

    if (selectedTab != null) {

     

  2. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 17 Nov 2010 Link to this post

    Hello William,

    The selected tab js code that you're running, is in the SelectedTab client-side event or when the page is loaded? I noticed you don't have any tabs marked as selected.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Bill
    Bill avatar
    175 posts
    Member since:
    Apr 2010

    Posted 17 Nov 2010 Link to this post

    cori, I have the following additonal html for the radmultipage. You can see that the selectedindex = 0.

    <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" ScrollBars="None">
                                                                                        <telerik:RadPageView ID="pvChart" runat="server" Width="100%" BackColor="LightGray">
                                                                                            <table width="100%" bgcolor="#F6F6F6" cellpadding="0" cellspacing="0">


    therefore, that signifes that the inital tab selected of my 3 parent tabs is the first one.

    Still can't figure out why the functionality in the previous post is not working....
  5. Answer
    Yana
    Admin
    Yana avatar
    4554 posts

    Posted 18 Nov 2010 Link to this post

    Hi William,

    You should also set SelectedIndex property to the tabstrip (it is set only to the multipage now).

    Best regards,
    Yana
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
Back to Top