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

Unable to get radiolist.SelecteValue when accessing the Radio button list from RadMultiPage

2 Answers 66 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dorababu
Top achievements
Rank 1
Dorababu asked on 28 May 2012, 01:22 PM
This is my design

<telerik:RadMultiPage ID="rdmpPersonal" runat="server" SelectedIndex="0">
        <telerik:RadPageView ID="rdpgSalary" runat="server">
            <telerik:RadAjaxPanel ID="rdpnlSalary" runat="server">
                <telerik:RadPanelBar runat="server" ID="rdpbSalary" ExpandMode="FullExpandedItem"
                    Skin="Vista" EnableEmbeddedSkins="false" Width="550px">
                    <Items>
                        <telerik:RadPanelItem Expanded="true" Text="Employee Salary Information" runat="server"
                            Selected="true">
                            <Items>
                                <telerik:RadPanelItem Value="SalaryInformation" runat="server">
                                    <ItemTemplate>
                                        <div class="text" style="background-color: #edf9fe">
                                            <ul class="formList" id="salaryinfo">
                                                <li>
                                                    <asp:Label Width="150px" runat="server" ID="lblSalaryPayRate" AssociatedControlID="rdbtnlstPayRate">What is the Pay Rate?</asp:Label>
                                                    <asp:RadioButtonList ID="rdbtnlstPayRate" runat="server" AutoPostBack="true" RepeatDirection="Horizontal"
                                                        OnSelectedIndexChanged="rdbtnlstPayRate_SelectedIndexChanged" Style="width: 155px"
                                                        ValidationGroup="salaryValidation">
                                                        <asp:ListItem Value="S">Salary</asp:ListItem>
                                                        <asp:ListItem Value="H">Hourly</asp:ListItem>
                                                    </asp:RadioButtonList>
                                                    <asp:RequiredFieldValidator ID="rfvsalaryTypeID" runat="server" ControlToValidate="rdbtnlstPayRate"
                                                        ErrorMessage="Please Select One Pay Rate" ValidationGroup="salaryValidation"></asp:RequiredFieldValidator>
                                                </li>
                                                 
                                        </div>
                                    </ItemTemplate>
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelItem>
                    </Items>
                </telerik:RadPanelBar>
            </telerik:RadAjaxPanel>
        </telerik:RadPageView>
    </telerik:RadMultiPage>

This my code
protected void rdbtnlstPayRate_SelectedIndexChanged(object sender, EventArgs e)
    {
RadioButton rdbtnlstPayRate = (RadioButton)rdpbSalary.FindItemByValue("SalaryInformation").FindControl("rdbtnlstPayRate");
          
      Unable to access rdbtnlstPayRate .SelectedValue can some one tell where I went wrong
    }

2 Answers, 1 is accepted

Sort by
0
Dorababu
Top achievements
Rank 1
answered on 28 May 2012, 01:25 PM
Oops sorry I did a mistake rather than calling RadioButtonList I used RadioButton
0
Peter
Telerik team
answered on 28 May 2012, 02:39 PM
Hi Dorababu,

Were you able to resolve the problem?

All the best,
Peter
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
General Discussions
Asked by
Dorababu
Top achievements
Rank 1
Answers by
Dorababu
Top achievements
Rank 1
Peter
Telerik team
Share this question
or