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

  • Home
  • SEARCH
  • 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 3285060
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:13:29+00:00 2026-05-17T20:13:29+00:00

Is it possible to have a Radio button list, like we have a checked

  • 0

Is it possible to have a Radio button list, like we have a checked List box?
Actually I want to load all the options from database to the list but do not want user to allow to check more than one item.

Also how to read it (say item 4 of the list) I want to store its value in the variable.

Thanks and best regards.
Furqan

  • 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-17T20:13:30+00:00Added an answer on May 17, 2026 at 8:13 pm

    If you mean the ASP.Net RadioButtonList-Control try this example:

    aspx(you can configure the datasource on the designer(show smart Tag):

    <asp:RadioButtonList ID="RadioButtonList1" runat="server" DataSourceID="SqlDataSource1"
         DataTextField="ClaimStatusName" DataValueField="idClaimStatus">
    </asp:RadioButtonList>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:RM2ConnectionString %>"
                SelectCommand="SELECT [idClaimStatus], [ClaimStatusName] FROM [dimClaimStatus]">
    </asp:SqlDataSource>
    

    A Radiobuttonlist allows user to select only one item by default.
    The selected Item is stored in RadioButtonList1.SelectedItem.

    EDIT: As you have clairified now that it’s a Winform issue, you need a GroupBox to allow user only to select one.

    To create the Radiobuttons dynamically from datasource and add them to the Groupbox, have a look at my samplecode:

        Private Sub Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Dim allStatus As DataSet2.StatusDataTable = New DataSet2TableAdapters.StatusTableAdapter().GetData()
            For i As Int32 = 0 To allStatus.Rows.Count - 1
                Dim status As DataSet2.StatusRow = allStatus(i)
                Dim rb As New RadioButton()
                rb.Text = status.ClaimStatusName
                rb.Tag = status.idClaimStatus
                rb.Location = New Point(Me.GroupBox1.Location.X + 5, Me.GroupBox1.Location.Y + i * rb.Height)
                AddHandler rb.CheckedChanged, AddressOf RBCheckedChanged
                Me.GroupBox1.Controls.Add(rb)
            Next
            Me.GroupBox1.Visible = allStatus.Rows.Count > 0
            If allStatus.Rows.Count > 0 Then
                Dim width, height As Int32
                Dim lastRB As Control = Me.GroupBox1.Controls(GroupBox1.Controls.Count - 1)
                width = lastRB.Width + 20
                height = lastRB.Height
                Me.GroupBox1.Size = New Size(width, allStatus.Rows.Count * height + 20)
            End If
        End Sub
    
        Private Sub RBCheckedChanged(ByVal sender As Object, ByVal e As EventArgs)
            Dim source As RadioButton = DirectCast(sender, RadioButton)
            Dim checkedRB As RadioButton = getCheckedRadioButton(Me.GroupBox1)
            'source and checkedRB are the same objetcs because we are in CheckedChanged-Event'
            'but getCheckedRadioButton-function works from everywhere'
        End Sub
    
        Private Function getCheckedRadioButton(ByVal group As GroupBox) As RadioButton
            For Each ctrl As Control In group.Controls
                If TypeOf ctrl Is RadioButton Then
                    If DirectCast(ctrl, RadioButton).Checked Then Return DirectCast(ctrl, RadioButton)
                End If
            Next
            Return Nothing
        End Function
    

    Remember that you must replace my data objects with yours.

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

Sidebar

Related Questions

Possible Duplicate: Check of specific radio button is checked I have these 2 radio
Possible Duplicate: Find out if radio button is checked with JQuery? Hi, i want
Possible Duplicate: jquery trigger - ‘change’ function I have a radio button set called
Is it possible to have the text in a radio button wrap itself? For
Possible Duplicate: jQuery disable SELECT options based on Radio selected (Need support for all
Quick question, Is it possible to have a form submitted when a radio button
Is it possible to create a button like radio button without using images? Would
I want the functionality of a radio button, yet have the option of choosing
Is it possible to have a <div> simultaneously (1) not take up all available
I have a scenario where I want to parse through all the values displayed

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.