473,508 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

custom layout : RadioButtonList

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.
Nov 17 '05 #1
1 7023
Hi,

The easy way is to use the DataList Control (template with label and
radioButtonList). You can also create your own RadioButtonList control
that derived from RadioButtonList and override the Render method.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
5644
by: Hazzard | last post by:
I store radiobuttonlist values in the db using the string value of the radio button item value. (nvarchar) I am creating an edit functionality on the asp.net form so that when I reuse my...
5
5498
by: DotNetGruven | last post by:
Anyone have any pointers on how to set the Value and Selected attributes in a ListItem in a RadioButtonList that is in a DataGrid? Here's what I have ------DataGrid------ -- BoundColumn 0 --...
6
7705
by: DotNetGruven | last post by:
I have a webform that has a DataGrid on it with a RadioButtonList in each row. It is a simple On & Off. When the User Clicks on either of the RadioButtons, I need to postback to the server and...
4
2896
by: Oleg | last post by:
I have a RadioButtonList with layout vertical. And having 2 columns. Let's say I have 6 items. It will create this look: o o o o o o What I want is to look like: o o o o
3
1321
by: Peter | last post by:
Hello, One thing I am looking to do is to create a couple of different custom Web Controls that can give me added options when specifying them in an ASP.NET page. For example: ...
4
3989
by: juststarter | last post by:
Hello, I have an aspx file where i've put a placeholder element. On load (page_load) i create dynamically an html table which contains a checkbox and a radiobuttonlist in each tablerow . The...
5
6975
by: Øyvind Isaksen | last post by:
I'm making a page to update articles. When a radiobuttonlist is displayed, I want the stored value to be displayed as default (checked). Example: I use a procedure to display the...
0
2131
by: webmaster | last post by:
Hi all, I'm tearing my hair out with this one. I have successfully implemented by own RadioButtonList in order to provide additional functionality and a DIV rather than TABLE-based layout in...
6
2627
by: SAL | last post by:
hello, I'm using a radiobuttonlist in an updatepanel in an item template in a Gridview control. I'm populating the radiobuttonlist in the RowDataBound event. I have the control toolkit registered...
0
7324
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7382
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7042
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7495
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5627
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4707
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3181
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
418
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.