AJAX ComboBox in Radpanelbar

8 posts, 0 answers
  1. daxriders
    daxriders avatar
    6 posts
    Member since:
    Sep 2009

    Posted 29 Sep 2009 Link to this post

    Hi,

    like the subject says, I'm trying to have an AJAX ComboxBox, among other controls, inside a RadPanelBar but it seems it doesn't work, since I'm getting a JavaScript error about a variable bestWidth that is set to -2.

    <body> 
        <form id="form1" runat="server"
        <asp:ScriptManager ID="ScriptManager1" runat="server"
        </asp:ScriptManager> 
        <div> 
            <asp:UpdatePanel ID="UpdatePanel1" runat="server"
            <ContentTemplate> 
                    
               <telerik:RadPanelBar ID="RadPanelBar1" runat="server"
                       <Items> 
                           <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1"
                            <Items> 
                                <telerik:RadPanelItem> 
                                <ItemTemplate>                                  
                                    <cc1:ComboBox ID="ComboBox1" runat="server" AutoCompleteMode="Append" AutoPostBack="true" DropDownStyle="DropDown"
                                    </cc1:ComboBox>                                    
                                </ItemTemplate> 
                                </telerik:RadPanelItem> 
                            </Items>                       
                           </telerik:RadPanelItem> 
                            
                            <telerik:RadPanelItem runat="server" Text="Root RadPanelItem2"
                            <Items> 
                                <telerik:RadPanelItem> 
                                <ItemTemplate> 
                                    <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
                                </ItemTemplate> 
                                </telerik:RadPanelItem> 
                            </Items> 
                           </telerik:RadPanelItem> 
                       </Items> 
                </telerik:RadPanelBar>      
            </ContentTemplate> 
            </asp:UpdatePanel> 
        </div> 
        </form> 
    </body> 

    Thanks in advance for your help.

    Dax
  2. Veselin Vasilev
    Admin
    Veselin Vasilev avatar
    2992 posts

    Posted 29 Sep 2009 Link to this post

    Hi daxriders,

    I could not reproduce the problem using your code and replacing <cc1:ComboBox...> with
    <telerik:RadComboBox ...>

    Let us know how to reproduce it locally.

    Regards,
    Veselin Vasilev
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. daxriders
    daxriders avatar
    6 posts
    Member since:
    Sep 2009

    Posted 29 Sep 2009 Link to this post

    It was a pure AJAX ComboBox issue. I just had to download the latest changeset of the AJAX Toolkit to fix the problem.
    Thanks for your answer!
  5. daxriders
    daxriders avatar
    6 posts
    Member since:
    Sep 2009

    Posted 29 Sep 2009 Link to this post

    There is another problem happening when the AJAX ComboBox is inside the PanelBar:  the list of items and the dropdown arrow are not visible. Can you maybe reproduce it by adding some random items to the combobox?

  6. Peter
    Admin
    Peter avatar
    6637 posts

    Posted 30 Sep 2009 Link to this post

    Hi daxriders,

    We added items manually to RadCombobox, but there wasn't a problem at our end:
    <form id="form1" runat="server">  
        <asp:ScriptManager ID="ScriptManager1" runat="server">  
        </asp:ScriptManager> 
        <div> 
            <asp:UpdatePanel ID="UpdatePanel1" runat="server">  
                <ContentTemplate> 
                    <telerik:RadPanelBar ID="RadPanelBar1" runat="server">  
                        <Items> 
                            <telerik:RadPanelItem runat="server" Text="Root RadPanelItem1">  
                                <Items> 
                                    <telerik:RadPanelItem> 
                                        <ItemTemplate> 
                                            <telerik:RadComboBox ID="RadComboBox1" runat="server">  
                                                <Items> 
                                                    <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" Value="RadComboBoxItem1" /> 
                                                    <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem2" Value="RadComboBoxItem2" /> 
                                                    <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem3" Value="RadComboBoxItem3" /> 
                                                    <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem4" Value="RadComboBoxItem4" /> 
                                                    <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem5" Value="RadComboBoxItem5" /> 
                                                </Items> 
                                            </telerik:RadComboBox> 
                                        </ItemTemplate> 
                                    </telerik:RadPanelItem> 
                                </Items> 
                            </telerik:RadPanelItem> 
                            <telerik:RadPanelItem runat="server" Text="Root RadPanelItem2">  
                                <Items> 
                                    <telerik:RadPanelItem> 
                                        <ItemTemplate> 
                                            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox> 
                                        </ItemTemplate> 
                                    </telerik:RadPanelItem> 
                                </Items> 
                            </telerik:RadPanelItem> 
                        </Items> 
                    </telerik:RadPanelBar> 
                </ContentTemplate> 
            </asp:UpdatePanel> 
        </div> 
        </form> 

    Let us know if we are missing something.


    Peter
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  7. daxriders
    daxriders avatar
    6 posts
    Member since:
    Sep 2009

    Posted 01 Oct 2009 Link to this post

    Hi Peter,

    sorry for not being clear in my explanation: I meant that I couldnt use an AJAX-ComboBox inside the RadPanelbar.

    <cc1:ComboBox ID="ComboBox1" runat="server">  
        <asp:ListItem Text="ListItem1" Value="ListItem1"></asp:ListItem> 
        <asp:ListItem Text="ListItem2" Value="ListItem2"></asp:ListItem> 
        <asp:ListItem Text="ListItem3" Value="ListItem3"></asp:ListItem> 
        <asp:ListItem Text="ListItem4" Value="ListItem4"></asp:ListItem> 
        <asp:ListItem Text="ListItem5" Value="ListItem5"></asp:ListItem> 
    </cc1:ComboBox> 

    So try putting the above instead of the RadComboBox in your example and you wont see your list of items.

    Cheers,
    Dax.
  8. Paul
    Admin
    Paul avatar
    4281 posts

    Posted 02 Oct 2009 Link to this post

    Hi daxriders,

    Actually, the problem is in the AJAX Combobox control when placed in an element which is initially not visible (style="display: none").

    <input id="Button1" type="button" value="Show DIV" onclick="OnClientClick()" /> 
        <div runat="server" id="div1" style="display: none"
            <cc1:ComboBox ID="ComboBox2" runat="server" DropDownStyle="DropDownList"
                <asp:ListItem Text="ListItem1" Value="ListItem1"></asp:ListItem> 
                <asp:ListItem Text="ListItem2" Value="ListItem2"></asp:ListItem> 
                <asp:ListItem Text="ListItem3" Value="ListItem3"></asp:ListItem> 
                <asp:ListItem Text="ListItem4" Value="ListItem4"></asp:ListItem> 
                <asp:ListItem Text="ListItem5" Value="ListItem5"></asp:ListItem> 
            </cc1:ComboBox> 
        </div> 
     
        <script type="text/javascript"
            function OnClientClick() { 
                var myDiv = $get('<%= div1.ClientID %>'); 
                myDiv.style.display = "block";             
            } 
             
        </script> 
     

    I suggest you use RadComboBox control instead.

    Sincerely yours,
    Paul
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  9. Sneha
    Sneha avatar
    2 posts
    Member since:
    Sep 2016

    Posted 29 Sep Link to this post

    Hi,

    How to access selected values of raddropdownlist  from radpanelbar.

     

    Thanks,

    Snehal 

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