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

Radiobuttonlist selectedIndexChange event does not fire

3 Answers 68 Views
RadioButtonList
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 30 Oct 2017, 04:31 PM

Radiobuttonlist selectedIndexChange event does not fire when nested inside of  a RadSplitter/RadPane

<telerik:RadSplitter
     runat="server"
     ID = "radSplitter1"
     ResizeWithBrowserWindow="true"
     Orientation="Vertical"
     ResizeMode="Proportional">

     <telerik:RadPane
          runat="server"
          ID=radPane1>
                <telerik:RadioButtonList
                     runat="server"
                     ID="radioButtonList1"
                     Direction="Vertical"
                     AutoPostBack="true"
                     OnSelectedIndexChange="RadioButtonList1_SelectedIndexChanged">

                     <Databindings
                           DataTextField="Name"
                           DataValueFields="Value"
                           DataSelectedField="Selected"/>

          </telerik:RadioButtonList>

     </telerik: RadPane>
</telerik:RadSplitter>

When I move the RadioButtonList to the outside of the RadSplitter then the RadioButtonList1_SelectedIndexChanged fires.  I'm using Telerik Version 2017.1.228.445


    

     

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 31 Oct 2017, 09:33 AM
Hi Tim,

The name of the RadButtonList's property to which you can attach a handler to the server-side SelectedIndexChange event is called OnSelectedIndexChanged (with -ed in the end). Changing the provided configuration in the way below triggers the event properly at my end both when it is placed inside and outside the Splitter:
<telerik:RadSplitter
    runat="server"
    ID="radSplitter1"
    ResizeWithBrowserWindow="true"
    Orientation="Vertical"
    ResizeMode="Proportional">
    <telerik:RadPane
        runat="server"
        ID="radPane1">
        <telerik:RadRadioButtonList
            runat="server"
            ID="radioButtonList1"
            Direction="Vertical"
            AutoPostBack="true"
            OnSelectedIndexChanged="radioButtonList1_SelectedIndexChanged">
            <DataBindings
                DataTextField="Name"
                DataValueField="Value"
                DataSelectedField="Selected" />
        </telerik:RadRadioButtonList>
    </telerik:RadPane>
    <telerik:RadPane ID="AdditionalRadPane" runat="server"></telerik:RadPane>
</telerik:RadSplitter>
protected void Page_Load(object sender, EventArgs e)
{
    radioButtonList1.DataSource = GetData();
    radioButtonList1.DataBind();
}
 
private IEnumerable<object> GetData()
{
    List<object> result = new List<object>() {
    new { Name = "English", Value = "en", Selected = true, Enabled = true },
    new { Name = "German", Value = "de", Selected = false, Enabled = true },
    new { Name = "french", Value = "fr", Selected = false, Enabled = true }
};
    return result;
}
 
protected void radioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
{
 
}


In addition, please note, that Splitter must contain at least two RadPanes in order to behave properly, thus I have added one additional Splitter to the configuration above:
https://docs.telerik.com/devtools/aspnet-ajax/controls/splitter/layout/declaring-splitter

Regards,
Vessy
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Tim
Top achievements
Rank 1
answered on 10 Nov 2020, 07:18 PM

This is my code with a RadRadioButtonList inside the RadSplitter

<telerik:RadSplitter
runat="server"
ID="radSplitter1"
ResizeWithBrowserWindow="true"
Orientation="Vertical"
ResizeMode="Proportional">

<telerik:RadPane
runat="server"
ID="radPane1">

<telerik:RadRadioButtonList runat="server" Width="99%" 
Skin="Simple"                              
ID="ButtonList"                             
Direction="Vertical"                             
OnSelectedIndexChanged="OnSelectedIndexChanged">
<Databindings DataTextField="Name" DataValueField="Value"                
DataSelectedField="Selected" /></telerik:RadRadioButtonList>
</telerik:RadPane><telerik:RadPane ID="RadPane2" runat="server">
</telerik:RadPane></telerik:RadSplitter>

Please see the attached are screen shots. RadRadioButtonlist OnSelectedIndexChanged works fine outside of Splitter, but does not work inside of a Splitter.
Telerik version 2020.2.617.45 
ASP Web Forms application

0
Vessy
Telerik team
answered on 13 Nov 2020, 03:07 PM

Hi Tim,

Can you remove all custom styles applied to the page where the Splitter is situated and see if the problem persists?

Also, please, make sure that there are no mixed render modes used on the page, you can see how to test this here:

https://docs.telerik.com/devtools/aspnet-ajax/knowledge-base/common-determine-mixed-render-mode

For convenience, I am attaching my test project to this reply. Please, modify it up to a point where the problem occurs If the above steps do not help in finding the root of the problem, and send it back to me.

Regards,
Vessy
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
RadioButtonList
Asked by
Tim
Top achievements
Rank 1
Answers by
Vessy
Telerik team
Tim
Top achievements
Rank 1
Share this question
or