RadComboBox:How to get current selected item tooltip using javascript or jquery

6 posts, 1 answers
  1. sandeep
    sandeep avatar
    17 posts
    Member since:
    May 2014

    Posted 02 Jul 2014 Link to this post

    Want to get the tooltip of a current selected item in radcombobox
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 02 Jul 2014 in reply to sandeep Link to this post

    Hi sandeep,

    Please try the below sample code snippet to achieve your scenario.

    ASPX:
    <telerik:RadComboBox ID="rcboTestItems" runat="server" EmptyMessage="--select--"
        OnClientSelectedIndexChanged="showToolTip">
        <Items>
            <telerik:RadComboBoxItem Text="Item1" />
            <telerik:RadComboBoxItem Text="Item2" />
            <telerik:RadComboBoxItem Text="Item3" />
        </Items>
    </telerik:RadComboBox>

    JavaScript:
    function showToolTip(sender, args) {
        sender._element.title = args._item._text;
    }

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. sandeep
    sandeep avatar
    17 posts
    Member since:
    May 2014

    Posted 03 Jul 2014 in reply to Princy Link to this post

    Hi Princy: Thanks for the reply 
    I think we are trying to assign a tool tip to the rad combo box item,but i have already given the tool tips for rad combo box items from code behind .Here i want to get that tool tip value of the current selected item as an alert,through java script... 
  5. sandeep
    sandeep avatar
    17 posts
    Member since:
    May 2014

    Posted 03 Jul 2014 Link to this post

    Please check the image, i want to get the "All other formats " through java script or j query.As in image  all other items have their own tool tips , i want to get those corresponding tool tip value when that respective item is selected,and display it as an alert.

    Thanks
  6. Answer
    Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 03 Jul 2014 in reply to sandeep Link to this post

    Hi Sandeep,

    Please try the below sample code snippet which works fine at my end.

    ASPX:
    <telerik:RadComboBox ID="rcboTestItems" runat="server" EmptyMessage="--select--"
        OnClientSelectedIndexChanged="showToolTip">
        <Items>
            <telerik:RadComboBoxItem Text="Images" ToolTip="Images" />
            <telerik:RadComboBoxItem Text="Other" ToolTip="All other formats" />
            <telerik:RadComboBoxItem Text="PDF" ToolTip="Pdf" />
        </Items>
    </telerik:RadComboBox>

    JavaScript:
    function showToolTip(sender, args) {
        alert("Selected Item ToolTip " + args.get_item().get_element().title);
    }

    Please provide your code if it doesn't help.
    Thanks,
    Princy.
  7. sandeep
    sandeep avatar
    17 posts
    Member since:
    May 2014

    Posted 07 Jul 2014 Link to this post

    Thank you Princy
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017