Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3997946
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:27:51+00:00 2026-05-20T07:27:51+00:00

I’m working on an ASP.NET where I have a RadListView (Telerik). Inside every RadListView’s

  • 0

I’m working on an ASP.NET where I have a RadListView (Telerik). Inside every RadListView’s item there’s a RadioButtonList with two radio buttons. What I need to do is:

  • on the first time the page gets loaded one of the two radio buttons must be selected by default;
  • on postback I have to check that the user has selected the other one (trying to do it with a CustomValidator);
  • on post back I have to keep the status of the RadioButtonLists.

Any idea on how can I do that?

Here’s part of my code:

<telerik:RadListView ID="rlvContracts" runat="server">
        <ItemTemplate>
            <fieldset style="margin-bottom: 30px;">
                    <table cellpadding="0" cellspacing="0">
                           [...]
                              <asp:RadioButtonList runat="server" EnableViewState="true" ID="rblContract" RepeatDirection="Horizontal">
                              <asp:ListItem Value="1" Text="Accept"></asp:ListItem>
                              <asp:ListItem Value="0" Text="I do not accept" Selected="True"></asp:ListItem>
                              </asp:RadioButtonList>
                           [...]
                              <!-- Custom Validator Here -->
                           [...]
                    </table>
                </fieldset>
        </ItemTemplate>
    </telerik:RadListView>

Any help (even links to tutorials) is apreciated

Thanks in advance,
Daniele

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T07:27:52+00:00Added an answer on May 20, 2026 at 7:27 am

    In order to do the first step you can either follow the idea that you posted in your code above (declarative setting of the selected RadioButton) or you could programmatically set it by doing something along the following lines:

    //MyRadListView is the name of the RadListView on the page
    RadListView myListView = MyRadListView;
    RadioButtonList myRadioButtonList = myListView.Items[0].FindControl("MyRadioButtonList") as RadioButtonList;
    myRadioButtonList.SelectedIndex = 0;
    

    As you can see you have to access the particular RadListView Item via the Items collection of the control. Once you have the item you’re interested in you can just use the FindControl() method which takes the ID of your control as a string.

    As for the validation part this is a possible implementation:

    ASPX:

            <asp:CustomValidator ID="RadioButtonListValidator" runat="server" ControlToValidate="MyRadioButtonList"
               OnServerValidate="RadioButtonListValidator_ServerValidate"
               ErrorMessage="Please select I Accept">
            </asp:CustomValidator>
    

    C#:

        protected void RadioButtonListValidator_ServerValidate(object sender, ServerValidateEventArgs e)
        {
            RadListView myListView = MyRadListView;
            RadioButtonList myRadioButtonList = myListView.Items[0].FindControl("MyRadioButtonList") as RadioButtonList;
            myRadioButtonList.SelectedIndex = 0;
    
            if (myRadioButtonList.SelectedValue != "1")
            {
                e.IsValid = false;
            }
        }
    

    That should take care of all ensuring that the “I Accept” RadioButton is selected upon PostBack.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.