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

Broken Control

0 Answers 67 Views
RadioButtonList
This is a migrated thread and some comments may be shown as answers.
Developer
Top achievements
Rank 1
Developer asked on 09 Aug 2017, 12:30 PM

Hello,

This control appears to have a major problem:

I have this code:

 

<telerik:RadRadioButtonList ID="RadRadioButtonList1" runat="server" AutoPostBack="False">
    <Items>
        <telerik:ButtonListItem Text="ButtonListItem1" Value="value1" Selected="True" />
        <telerik:ButtonListItem Text="ButtonListItem2" Value="value2" />
    </Items>
</telerik:RadRadioButtonList>

 

I then have button with the following code:

protected void RadButton1_Click(object sender, EventArgs e)
{
    RadLabel1.Text = RadRadioButtonList1.SelectedItem.Value;
}

 

When this is run I get an error:

{"Object reference not set to an instance of an object."}

So the system does not recognise the items.

 

No answers yet. Maybe you can help?

Tags
RadioButtonList
Asked by
Developer
Top achievements
Rank 1
Share this question
or