all groups > asp.net webcontrols > july 2003 >
You're in the

asp.net webcontrols

group:

custom layout : RadioButtonList


custom layout : RadioButtonList M Aamir Maniar
7/29/2003 11:24:02 PM
asp.net webcontrols:
Well you can create your own custom web control to achive
this

regards
m aamir maniar

[quoted text, click to view]
custom layout : RadioButtonList Christian H
7/30/2003 3:05:27 AM
Hi!

I'm wondering how I can add extra html to a radiobuttonList, so that I can
control how:
-the whole radioButtonList is rendered.
-each of the radiobutton elements are rendered.

What I am basically trying to do is to combine x radioButtonlists, so that
the output will look like this:
----------------------------------------------------------------------------
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>True</td>
<td>False</td>
<td>Don't know</td>
<td></td>
</tr>
<tr>
<td><input id="question_4_0_0" type="radio" value="9"
name="question_4_0"></td>
<td><input id="question_4_0_1" type="radio" value="10"
name="question_4_0"></td>
<td><input id="question_4_0_2" type="radio" value="-"
name="question_4_0"></td>
<td>&nbsp;Answer 1</td>
</tr>
<tr>
<td><input id="question_4_1_0" type="radio" value="1"
name="question_4_1"></td>
<td><input id="question_4_1_1" type="radio" value="2"
name="question_4_1"></td>
<td><input id="question_4_1_2" type="radio" value="-"
name="question_4_1"></td>
<td>&nbsp;Answer 2</td>
</tr>
<tr>
<td><input id="question_4_2_0" type="radio" value="1"
name="question_4_2"></td>
<td><input id="question_4_2_1" type="radio" value="2"
name="question_4_2"></td>
<td><input id="question_4_2_2" type="radio" value="-"
name="question_4_2"></td>
<td>&nbsp;Answer 3</td>
</tr>
</table>
----------------------------------------------------------------------------

The radiobuttonlists are dynamically created, using data from a database.
My idea was to add the <table> start and end tags manually as I am looping
through the database.

What I need though, is a way to :
-add <tr> start and end tags for each radioButtonlist
-add <td> start and end tags for each radioButton within each
radioButtonlist.

I imagine that there is a method I can override, that deals with the
creation of the radiobuttonlist, and that there also is a method I can
override, that creates the child elements (each radiobutton) within the
radiobuttonlist.

If anyone knows what methods I need to override, and how I do this, I would
really appreciate it.


AddThis Social Bookmark Button