I want round radiobutton border .


I want round radiobutton border .


I think that radio-buttons usually do not have borders.
To set the borders, try something like this:
<style>
.MyRadioButtons
{
border-radius: 4pt;
}
</style>
. . .
<asp:RadioButton ID="RadioButton1" runat="server" CssClass="MyRadioButtons" . . .
The <style> element can be placed before the repeater, to .css file, or any appropriate place. To simplify the HTML, you can move more properties to this style.
Actually I have already tried this,but it didn't worked because radiobutton is set to false when there is no value and in this case the radiobutton border in visible.

Actually I have already tried this,but it didn't worked because radiobutton is set to false when there is no value and in this case the radiobutton border in visible.
Radio buttons are mutually exclusive options. These options, as explained in your other thread, should come from a data set usually a lookup table. The selected value of the radio button list is what the user selects. Rethink your design and use tools appropriately then this problem will simply go away.
Another option is to use standard HTML inputs so you have more control over the HTML. I mention this because it looks like you are following a CSS/JS template.
Hi @Dikshadudi-8186 ,
Actually I have already tried this,but it didn't worked because radiobutton is set to false when there is no value and in this case the radiobutton border in visible.
What's your meanings? Which controls do you want to have the round border? The radiobutton is only could selected one in list.
Best regards,
Yijing Sun
Code behind
Public Class _default3
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
RadioButtonList1.DataSource = GetSizes()
RadioButtonList1.DataValueField = "Id"
RadioButtonList1.DataTextField = "Size"
RadioButtonList1.DataBind()
End If
End Sub
Protected Function GetSizes() As DataTable
Dim Connectionstring As String = ConfigurationManager.ConnectionStrings("DefaultConnection").ToString()
Dim Table As New DataTable()
Dim queryString As String = "SELECT Id, Size
FROM dbo.SizeLookup"
Using conn As New SqlConnection(Connectionstring)
Dim cmd As New SqlCommand(queryString, conn)
cmd.CommandType = CommandType.Text
conn.Open()
Using reader As SqlDataReader = cmd.ExecuteReader()
Table.Load(reader)
End Using
End Using
Return Table
End Function
Protected Sub Button1_Click(sender As Object, e As EventArgs)
Label1.Text = "You Selected " & RadioButtonList1.SelectedValue & " " & RadioButtonList1.SelectedItem.Text
End Sub
End Class
SQL
CREATE TABLE dbo.SizeLookup (
Id INT PRIMARY KEY IDENTITY(1,1),
Size VARCHAR(3),
[Description] VARCHAR(256)
)
INSERT INTO dbo.SizeLookup
VALUES ('XS', 'Extra Small'),
('S', 'Small'),
('M', 'Medium'),
('L', 'Large'),
('XL', 'Extra Large')
You can add a style to a radio button.
Say, I have this listview:

The radio buttons don't look all that great, so I have this style sheet:

And now for the radiobutton list, I set CssClass="rMyChoice"
and now my rb becomes this:

And you can tweak that radio button still. I actually send the text part of the rb some imbedded HTML with in-line (base64) graphics. And now with a similar style sheet like the above? I get this for my rb's:

Each set above is a radio button list. So, in above, we see "issue".
That markup was this:

And code to fill the issues radio button list was this:
RIssues.DataSource =
` Myrst("SELECT ID, IssueImage + Issue AS IssueImage2 FROM Issues ORDER BY ID", My.Settings.WebIssues)
RIssues.DataBind()
And, the above simple markup, 2 lines of database code (database driven for the choices).
And we get this:

So, you can apply quite much any kind of style you want to your radio buttons - that is quite much the magic of what css can do for you. I in fact find that css can quite much achieve anything humans are able to cook up with their brains.
I don't like writing or setting up css - nasty stuff.
but, I for sure LOVE the output - and the results!!!
Note how I am not just limited to feeding the "text" of the radiobutton list JUST text - I am in above feeding the text property of the radiobutton HTML text - with imbedded graphics. So, you not even limited to display of a the default radio button (the css= hides that ).
Regards,
Albert D. Kallal (Access MVP 2003-2017)
Edmonton, Alberta Canada
7 people are following this question.