473,770 Members | 2,217 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 radioButtonlist s, 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;Answe r 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;Answe r 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;Answe r 3</td>
</tr>
</table>
----------------------------------------------------------------------------

The radiobuttonlist s 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 7042
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
5671
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 dataentry form for edit, I search the database for the row containing the data I want, and then populate all the form fields. here is what I have so far. What I don't know what to do is for cases where a dirty database has no associated value for the...
5
5511
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 -- -- BoundColumn 1 -- -- BoundColumn 2 -- -- TemplateColumn 4 -- -- RadioButtonList --
6
7772
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 update the database. Here is the control containment hierarchy: ASP Page Static User Control // just provides a pretty border around
4
2914
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
1332
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: <asp:RadioButtonList id=RadioButtonList1 runat="server"> <asp:ListItem myvalue1="x" myvalue2="y">Item 1</asp:ListItem> <asp:ListItem myvalue1="a" myvalue2="b">Item 2</asp:ListItem> <asp:ListItem myvalue1="g" myvalue2="h">Item 3</asp:ListItem>
4
4009
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 radiobuttonlist contains two items (yes,no). Both the checkboxes and the radiobuttonlist are NOT autopostbacked ( .autopostback = false). When i press the submit button a sub (submit_pressed) is run. My problem is that i can not get the selected items...
5
6985
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 RadioButtonList. An input to this procedure is the ID that is stored in the database. I want the radiobuttonlist to show the radiobutton with datavaluefield = savedID as checked when it is displayed.
0
2155
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 one of my ASP.NET 1.1 web forms. This involves a fairly simple inheritance of the System.Web.UI.WebControls.RadioButtonList class, with some new properties added and the Render sub overridden. When I come to render each radio item, I do the...
6
2643
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 in the page and I've got code to get the selected value from it in the Radiobuttonlist_SelectedIndexChanged event. The code in there is: Protected Sub rblFMSValue_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
0
9619
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10102
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10038
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9910
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8933
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5354
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4007
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3609
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.