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

Rad Radio Button List disappers after postback

3 Answers 335 Views
RadioButtonList
This is a migrated thread and some comments may be shown as answers.
William
Top achievements
Rank 1
William asked on 03 Oct 2019, 04:57 PM

I am experiencing an issue when I converted a .NET radioButtonList to a Telerik.Web.UI.RadRadioButtonList.

We display Yes/No Radio Buttons, then depending on which was clicked we show a panel.

After the OnSelectedIndexChanged fires the RadRadioButtonList will disappear. 

Additionally during the Event the SelectedValue is not set, and the SelectedIndex = -1. Niether of these issues happen with the ASP RadioButtonList object. 

Any help would be greatly appreciated.

WG

 

Sample code to reproduce error:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="TelerikRadioButtonListError.aspx.vb" Inherits="TelerikQuickQuote.TelerikRadioButtonListError" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>

    <form id="form1" runat="server">
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <div>
            <span>Are you Currently Insured:</span>

            <telerik:RadRadioButtonList ID="RBL_CurrentlyInsured" runat="server" AutoPostBack="true" OnSelectedIndexChanged="RBL_CurrentlyInsured_SelectedIndexChanged">
                <Items>
                    <telerik:ButtonListItem Text="Yes" Value="1" Selected="false"></telerik:ButtonListItem>
                    <telerik:ButtonListItem Text="No" Value="0" Selected="false"></telerik:ButtonListItem>
                </Items>
            </telerik:RadRadioButtonList>

            <asp:Panel ID="PNL_PresentlyInsured" runat="server" Visible="false">
                Presently Insured Controls
            </asp:Panel>
            <asp:Panel ID="PNL_NotPresentlyInsured" runat="server" Visible="false">
                Not Presently Insured Controls
            </asp:Panel>
        </div>

    </form>
</body>
</html>

Public Class TelerikRadioButtonListError
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub

    Protected Sub RBL_CurrentlyInsured_SelectedIndexChanged(sender As Object, e As EventArgs)
        Dim isPresentlyInsured As Boolean = (RBL_CurrentlyInsured.SelectedValue = "1")
        If isPresentlyInsured Then
            PNL_PresentlyInsured.Visible = True
            PNL_NotPresentlyInsured.Visible = False
        Else
            PNL_PresentlyInsured.Visible = False
            PNL_NotPresentlyInsured.Visible = True
        End If
    End Sub
End Class

 

 

 

3 Answers, 1 is accepted

Sort by
0
Vessy
Telerik team
answered on 08 Oct 2019, 09:08 AM

Hi William,

I tested the provided setup but was not able to reproduce the reported behavior. Can you, please, share some more details on the exact scenario in which the problem occurs? Which version of the controls is used in your application? Are you facing the reported issue in all browsers or just in specific one?

For convenience, I am attaching my test project to this reply. Can you test it and see if it is working properly at your end as well? I am using the latest version of the controls in it.

Regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
William
Top achievements
Rank 1
answered on 08 Oct 2019, 12:13 PM

The project you sent worked on my end.  I checked the references and my project was referencing the latest version but they were the .Net 3.5 controls (2019.3.917.35) where as the version you sent was .Net 4.5 (2019.3.917.45). 

As for the browser I experienced the issue in both Firefox and IE when using the 3.5 version.

I have updated my project to use 4.5, and updated the Telerik controls to the 4.5 version and all is working as expected.

Thanks again for the help.

 

 

 

 

0
Vessy
Telerik team
answered on 08 Oct 2019, 04:19 PM

Hi,

Thanks a lot for the update, William - we will have this .NET 3.5 specific in mind in case any other client runs into it.

Kind regards,
Vessy
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
RadioButtonList
Asked by
William
Top achievements
Rank 1
Answers by
Vessy
Telerik team
William
Top achievements
Rank 1
Share this question
or