Click here to Skip to main content
12,503,321 members (66,995 online)
Click here to Skip to main content
Add your own
alternative version

Stats

36.8K views
204 downloads
18 bookmarked
Posted

Enhanced RadioButtonList web control

, 22 Aug 2007
Rate this:
Please Sign up or sign in to vote.
The article describes how to enhance .NET's RadioButtonList web control to make the text wrap nicely on multiple lines in front of each radiobutton.

Introduction

When you use .NET RadioButtonList web control you properbly know about it's left margin (wrapping) problem (see left picture below). This article will give you the source code to make a Web Custom Control that inherits from the RadioButtonList control to fix this problem.

Sample image

Here is the source code. You can either copy the code below or download the source file at the top of this article.

The only thing that happens when you use this Web Control, is when the radiobuttonlist has been rendered to the page a javascript will split the radiobutton and it's associated text into into two <td> tags instead of one.

using System; 
using System.Web.UI;
using System.Web.UI.WebControls; 
using System.ComponentModel;
using System.Text; 

namespace Dfds.MCms.WebControls

{

/// <span class="code-SummaryComment"><summary> 
</span>

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

JacobEgholm
Web Developer
Denmark Denmark
No Biography provided

You may also be interested in...

Pro
Pro

Comments and Discussions

 
GeneralMy vote of 1 Pin
ii_noname_ii7-Jul-10 2:07
memberii_noname_ii7-Jul-10 2:07 
GeneralUse CSS to generate the same result Pin
Barbara1124-Aug-07 11:52
memberBarbara1124-Aug-07 11:52 
GeneralRe: Use CSS to generate the same result Pin
codefranz19-Mar-08 10:17
membercodefranz19-Mar-08 10:17 
GeneralUse CSS to generate the same result Pin
Barbara1124-Aug-07 11:49
memberBarbara1124-Aug-07 11:49 
QuestionDoes it work for IE 7.0? Pin
sdanish7822-Aug-07 9:58
membersdanish7822-Aug-07 9:58 
AnswerRe: Does it work for IE 7.0? Pin
JacobEgholm22-Aug-07 10:27
memberJacobEgholm22-Aug-07 10:27 
GeneralRe: Does it work for IE 7.0? Pin
sdanish7823-Aug-07 6:50
membersdanish7823-Aug-07 6:50 
GeneralRe: Does it work for IE 7.0? Pin
JacobEgholm23-Aug-07 7:05
memberJacobEgholm23-Aug-07 7:05 
GeneralRe: Does it work for IE 7.0? Pin
sdanish7823-Aug-07 7:26
membersdanish7823-Aug-07 7:26 
Generalnot sure it works in Firefox... Pin
hawk_eye0116-Mar-07 11:13
memberhawk_eye0116-Mar-07 11:13 
GeneralRe: not sure it works in Firefox... Pin
ufriends23-Jul-07 8:31
memberufriends23-Jul-07 8:31 
Generalbetter javascript DOM support Pin
patt23-Aug-06 22:33
memberpatt23-Aug-06 22:33 
GeneralRe: better javascript DOM support [modified] Pin
JacobEgholm24-Aug-06 3:57
memberJacobEgholm24-Aug-06 3:57 
GeneralRe: better javascript DOM support Pin
p daddy24-Jan-07 5:37
memberp daddy24-Jan-07 5:37 
GeneralRe: better javascript DOM support Pin
JacobEgholm28-Jan-07 19:19
memberJacobEgholm28-Jan-07 19:19 
Generaldocument.all Pin
Alsvha18-Aug-06 4:50
memberAlsvha18-Aug-06 4:50 
GeneralRe: document.all Pin
JacobEgholm19-Aug-06 5:16
memberJacobEgholm19-Aug-06 5:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.160919.1 | Last Updated 22 Aug 2007
Article Copyright 2006 by JacobEgholm
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid