Display Image on Selected radtabstrip

5 posts, 0 answers
  1. Anshul
    Anshul avatar
    8 posts
    Member since:
    Mar 2013

    Posted 24 Feb 2014 Link to this post

    Hello team,

    I am using telerik radtabstrip in my project. I want to display image on selected radtabstrip, is there possible. i tried a lot on OnClientTabSelected="OnClientTabSelected" with javascript function. plaese help me out how can i solve my problem.

    My code is that 

    <script type="text/javascript" language="javascript">
             function OnClientTabSelected(sender, eventArgs) {
                 var tab = eventArgs.get_tab();
                 alert(get_text());

                 tab.set_imageUrl('../images/arrow-on.png');
                 tab.get_element().style.ImageUrl = "Images\arrow-on.png";

             }
        </script>
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Feb 2014 in reply to Anshul Link to this post

    Hi Anshul,

    Please have a look into the sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" OnClientTabSelected="OnClientTabSelected1">
        <Tabs>
            <telerik:RadTab Text="Tab1">
            </telerik:RadTab>
            <telerik:RadTab Text="Tab2">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>

    JavaScript:
    <script type="text/javascript">
        function OnClientTabSelected1(sender, args) {
            args.get_tab().set_imageUrl("delete-icon.png");
        }
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Anshul
    Anshul avatar
    8 posts
    Member since:
    Mar 2013

    Posted 24 Feb 2014 in reply to Shinu Link to this post

    Thanx for ur response.
    I tried same, but when page load image automatically hide..
  5. Anshul
    Anshul avatar
    8 posts
    Member since:
    Mar 2013

    Posted 24 Feb 2014 Link to this post

    Can i implement this on Server side, like OnTabClick="RadTabStrip1_TabClick"
    please help me how can i solve this problem.
  6. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 24 Feb 2014 in reply to Anshul Link to this post

    Hi Anshul,

    Please try the following c# code snippet which works fine at my end.

    C#:
    protected void RadTabStrip1_TabClick(object sender, Telerik.Web.UI.RadTabStripEventArgs e)
    {
        e.Tab.ImageUrl = "delete-icon.png";
    }

    Thanks,
    Shinu.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017