radcombobox in radtooltip items update clientside

2 posts, 1 answers
  1. Fit2Page
    Fit2Page avatar
    345 posts
    Member since:
    Feb 2007

    Posted 11 Aug Link to this post

    I am trying to alter the items collection of a radcombobox which is placed in a radtooltip with JS like

     

      <telerik:RadToolTip ID="tt_svg_combo" HideEvent="ManualClose" OffsetX="20" RenderMode="Lightweight" Skin="Default" Width="400" Height="400" runat="server">
           <telerik:RadComboBox ID="rcb_tooltip" runat="server"><Items>
                <telerik:RadComboBoxItem Text="aa" Value="aa" />
                                                                 </Items></telerik:RadComboBox>
        </telerik:RadToolTip>

     

     

    and JS:

      var ott
                        ott = $find("<%=tt_svg_combo.ClientID%>");
                        var combo = $find("<%= rcb_tooltip.ClientID%>");
                        var items = combo.get_items();
                        combo.trackChanges();
                        var comboItem

    var str='1$2$3$4$5'
                        var a = str.split("$");

                        for (i = 0; i < a.length; i++) {
                            comboItem = new Telerik.Web.UI.RadComboBoxItem();
                            comboItem.set_text(a[i]);
                            comboItem.set_value(a[i]);
                            items.add(comboItem);
                        }

                        combo.commitChanges();
                    }
                  
                    setTimeout(function () {
                        ott.show();
                    }, 1000);

     

    None of the added items are showing up on tooltip show.

    When I place rcb on the page itself it works OK

  2. Answer
    Peter Milchev
    Admin
    Peter Milchev avatar
    141 posts

    Posted 16 Aug Link to this post

    Hello,

    The items are added correctly but the dropdown is with lower index that the ToolTip and that is why you do not see the items. Here is a sample implementation of the ComboBox with z-index higher than the ToolTip:

    <telerik:RadComboBox ID="rcb_tooltip" runat="server" Style="z-index: 10000">
        <Items>
            <telerik:RadComboBoxItem Text="aa" Value="aa" />
        </Items>
    </telerik:RadComboBox>

    Here is a forum thread with similar issue: Combobox in Tooltip - show dropdown on load.

    Regards,
    Peter Milchev
    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