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

[Solved] RadCombo with embedded Radiobuttons issue

6 Answers 153 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Stanley
Top achievements
Rank 1
Stanley asked on 12 Jun 2008, 08:59 PM
Hello All,

Just started playing around with the controls and they are great! I'm having one small issue where I have a radcombo box with radiobuttons.

If I select an item in the combo box under firefox it works fine. If I select an item under IE it does not work.  Autopostback is set to true. And I have the RadAjaxmanger enabled for the combo box.

Any ideas?

  protected void RadioButtonList1_SelectedIndexChanged1(object sender, EventArgs e)  
        {  
            RadioButtonList radiodayweek = (RadioButtonList)RadComboBox2.SelectedItem.FindControl("RadioButtonList1");  
            Profile.Chartdayweek = radiodayweek.SelectedValue.ToLower();  
            Label1.Text = Profile.Chartdayweek;  
        } 

<telerik:RadComboBox ID="RadComboBox2" Runat="server" Skin="Sunset"   
        Width="385px" AutoPostBack="True">  
          
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        <ItemTemplate> 
            Select Day or Week<asp:RadioButtonList ID="RadioButtonList1" runat="server"   
                AutoPostBack="True" Height="27px"   
                onselectedindexchanged="RadioButtonList1_SelectedIndexChanged1"   
                RepeatDirection="Horizontal" Width="221px">  
                <asp:ListItem Selected="True">Day</asp:ListItem> 
                <asp:ListItem>Week</asp:ListItem> 
            </asp:RadioButtonList> 
            <br /> 
            Select Chart Type<br /> 
            <asp:RadioButtonList ID="RadioButtonList2" runat="server" AutoPostBack="True"   
                Height="26px" onselectedindexchanged="RadioButtonList2_SelectedIndexChanged"   
                RepeatDirection="Horizontal" Width="224px">  
                <asp:ListItem Selected="True">Bar</asp:ListItem> 
                <asp:ListItem>Line</asp:ListItem> 
                <asp:ListItem>Spline</asp:ListItem> 
            </asp:RadioButtonList> 
        </ItemTemplate> 
        <Items> 
            <telerik:RadComboBoxItem /> 
        </Items> 
    </telerik:RadComboBox> 

6 Answers, 1 is accepted

Sort by
0
Helen
Telerik team
answered on 13 Jun 2008, 03:32 PM
Hello Stanley,

Please see the code below which works at our side:

aspx:
<telerik:RadAjaxManager id="AjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadComboBox2">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadComboBox2" /> 
                        <telerik:AjaxUpdatedControl ControlID="Label1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
          
        </telerik:RadAjaxManager> 
          
            <telerik:RadComboBox ID="RadComboBox2" Runat="server" Skin="Sunset"      
        Width="385px" AutoPostBack="True">     
             
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>    
        <ItemTemplate>    
            Select Day or Week<asp:RadioButtonList ID="RadioButtonList1" runat="server"      
                AutoPostBack="True" Height="27px"      
                onselectedindexchanged="RadioButtonList1_SelectedIndexChanged1"      
                RepeatDirection="Horizontal" Width="221px">     
                <asp:ListItem Selected="True">Day</asp:ListItem>    
                <asp:ListItem>Week</asp:ListItem>    
            </asp:RadioButtonList>    
            <br />    
            Select Chart Type<br />    
            <asp:RadioButtonList ID="RadioButtonList2" runat="server" AutoPostBack="True"      
                Height="26px" onselectedindexchanged="RadioButtonList1_SelectedIndexChanged1"      
                RepeatDirection="Horizontal" Width="224px">     
                <asp:ListItem Selected="True">Bar</asp:ListItem>    
                <asp:ListItem>Line</asp:ListItem>    
                <asp:ListItem>Spline</asp:ListItem>    
            </asp:RadioButtonList>    
        </ItemTemplate>    
        <Items>    
            <telerik:RadComboBoxItem runat="server" />    
        </Items>    
    </telerik:RadComboBox>    
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label> 

cs:
protected void RadioButtonList1_SelectedIndexChanged1(object sender, EventArgs e)  
    {  
             
            RadioButtonList radiodayweek = (RadioButtonList)RadComboBox2.SelectedItem.FindControl("RadioButtonList1");     
            Label1.Text = radiodayweek.SelectedValue.ToLower();     
               
      }   

What are the exact AjaxSettings of RadAjaxManager you are using? Could you compare your code to the code above?

Regards,
Helen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Stanley
Top achievements
Rank 1
answered on 13 Jun 2008, 03:50 PM


   <telerik:AjaxSetting AjaxControlID="RadComboBox2">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="Label1" /> 
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox2" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 

Here is the snippet of the AjaxManager code. I already deleted the object and readded it. Ill try again with a new one and different name see if it has the same behaviour. I am using VS2008 if that makes a difference.

I just added a new Combobox and dropped in a radiolistbox. Still the same behaviour its like the autopostback resets the item to its orginal state.

No cs code for the new control.

<telerik:RadComboBox ID="RadComboBoxChartOptions" Runat="server" Width="386px">  
        <Items> 
            <telerik:RadComboBoxItem runat="server" /> 
        </Items> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
        <ItemTemplate> 
            <asp:RadioButtonList ID="RadioButtonList3" runat="server" AutoPostBack="True"   
                RepeatDirection="Horizontal">  
                <asp:ListItem Selected="True">day</asp:ListItem> 
                <asp:ListItem>week</asp:ListItem> 
            </asp:RadioButtonList> 
        </ItemTemplate> 
    </telerik:RadComboBox> 


Thanks!
0
Stanley
Top achievements
Rank 1
answered on 13 Jun 2008, 04:09 PM
Ok another update. I created a brand new page. Works in firefox not in IE7.

Added the radcombo box, dropped in 1 radiolistbox. Whenever I select an item it does the postback and reverts to original state.

No cs code was added just wanted to check if the radiobutton would stay selected.  It does not. Maybe a bug with IE7?

<telerik:RadComboBox ID="RadComboBox1" runat="server" Height="53px" Width="332px">  
    <Items> 
        <telerik:RadComboBoxItem runat="server" Text="RadComboBoxItem1" /> 
    </Items> 
<CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
    <ItemTemplate> 
        <asp:RadioButtonList ID="RadioButtonList1" runat="server" AutoPostBack="True"   
            Height="57px" RepeatDirection="Horizontal" Width="329px">  
            <asp:ListItem Selected="True">one</asp:ListItem> 
            <asp:ListItem>two</asp:ListItem> 
        </asp:RadioButtonList> 
    </ItemTemplate> 
</telerik:RadComboBox> 
      
    </div> 
    <telerik:RadAjaxManager runat="server">  
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="RadComboBox1">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="RadComboBox1" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 
0
Helen
Telerik team
answered on 17 Jun 2008, 12:33 PM
Hi Stanley,

What is the exact version of RadComboBox that you are using? If it is the Q1 2008 SP1(current official release), you may try the following javascript code:

function disableDetaching()  
{  
var comboBox = $find("RadComboBox1");  
 
if (comboBox)  
{  
if (comboBox._isDetached)  
{  
comboBox._attachDropDown();  
}  
 
//set the _detachDropDown and _attachDropDown internal functions to empty ones:  
comboBox._detachDropDown = function(){}  
comboBox._attachDropDown = function(){}  
}  
}  
 
Sys.Application.add_load(disableDetaching); 

Hope this hels.

Regards,
Helen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Stanley
Top achievements
Rank 1
answered on 19 Jun 2008, 06:56 PM
That worked! One small issue with it though.

The text for the radiobuttons now sits on top of the radiobutton after calling the fuction.

No biggie since I can do a few work arounds to move the text.

Thanks again
0
Helen
Telerik team
answered on 20 Jun 2008, 04:51 PM
Hello Stanley,

We are happy to hear that you found a workaround of the problem by yourself.

Feel free to contact us if other problems pop up.


Regards,
Helen
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
ComboBox
Asked by
Stanley
Top achievements
Rank 1
Answers by
Helen
Telerik team
Stanley
Top achievements
Rank 1
Share this question
or