This is a migrated thread and some comments may be shown as answers.

AJAX ComboBox in Radpanelbar

7 Answers 154 Views
PanelBar
This is a migrated thread and some comments may be shown as answers.
daxriders
Top achievements
Rank 1
daxriders asked on 29 Sep 2009, 08:56 AM
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

7 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 29 Sep 2009, 09:35 AM
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.
0
daxriders
Top achievements
Rank 1
answered on 29 Sep 2009, 11:56 AM
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!
0
daxriders
Top achievements
Rank 1
answered on 29 Sep 2009, 01:22 PM
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?

0
Peter
Telerik team
answered on 30 Sep 2009, 12:31 PM
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.
0
daxriders
Top achievements
Rank 1
answered on 01 Oct 2009, 02:59 PM
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.
0
Paul
Telerik team
answered on 02 Oct 2009, 06:57 AM
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.
0
Sneha
Top achievements
Rank 1
answered on 29 Sep 2016, 11:44 AM

Hi,

How to access selected values of raddropdownlist  from radpanelbar.

 

Thanks,

Snehal 

Tags
PanelBar
Asked by
daxriders
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
daxriders
Top achievements
Rank 1
Peter
Telerik team
Paul
Telerik team
Sneha
Top achievements
Rank 1
Share this question
or