473,396 Members | 1,772 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Setting Radio Button In A Item Template Of A DataList

Hi,

I have a DataList with an Item Template that contains an image and
three radio buttons, which are used to indicate the image's status. How
can I set the appropriate radio button to checked, when I load the
DataList from the database?

Thanks in advance.

Pierre

Nov 19 '05 #1
3 2688
Hi pierre
How u know the image status
better use RadioButtonList rather than tree RadioButton

"pi***********@psitek.com" wrote:
Hi,

I have a DataList with an Item Template that contains an image and
three radio buttons, which are used to indicate the image's status. How
can I set the appropriate radio button to checked, when I load the
DataList from the database?

Thanks in advance.

Pierre

Nov 19 '05 #2
Pierre,

You need to make a databind expression for button's Checked property. Read
about databinding in MSDN Library.

Eliyahu

<pi***********@psitek.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Hi,

I have a DataList with an Item Template that contains an image and
three radio buttons, which are used to indicate the image's status. How
can I set the appropriate radio button to checked, when I load the
DataList from the database?

Thanks in advance.

Pierre

Nov 19 '05 #3
Handle the ItemDataBound event in your code. Then get the RadioButtonList
using:
RadioButtonList rbl = (RadioButtonList) e.Item.FindControl("myRBL");
This gets the RadioButtonList for the current item in the DataList. Then set
as selected the RadioButton you like.

Hope this helps!
Regards,
Kostadin Kostov

"pi***********@psitek.com" wrote:
Hi,

I have a DataList with an Item Template that contains an image and
three radio buttons, which are used to indicate the image's status. How
can I set the appropriate radio button to checked, when I load the
DataList from the database?

Thanks in advance.

Pierre

Nov 19 '05 #4

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

Similar topics

3
by: moondaddy | last post by:
using vb.net 1.1 I have a datalist and in it's item template I have 2 buttons, 'edit' and 'ShipToThisAddress'. The edit button works fine and it opens up the edit template as it works with the...
3
by: Stimp | last post by:
I have a datalist that outputs a link to a picture in each ItemTemplate: e.g. <asp:DataList id="DataList1" ...etc> <ItemTemplate> <a href='Pic.aspx?pic=somenumber'>picture</a> </ItemTemplate>...
0
by: David Hearn | last post by:
I have a datalist with an ItemTemplate set up. In the item template, I have a radio button. I have set the groupname on the radio button so that you should only be able to have one radio button...
3
by: David Hearn | last post by:
I have a datalist that I have inserted a radio button into. The datalist populates with a list of items and each one has a radio button next to it. I need to use the radio button to allow the user...
2
by: cindy | last post by:
When my datalist loads I am trying to make the checked value in a radio button group reflect which value is stored in the data and then fire and event when the CheckChanged event fires. private...
16
by: Vikas Kumar | last post by:
i am selectin some data from database and through reader showing it in datalist as above now for radio buttons i have single column which returns 1,2,3 and according to that i want one of above...
5
by: Vikas Kumar | last post by:
i had coded like this <ItemTemplate> <table width="100%"> <tr width="100%"> <td width="25%"><%#DataBinder.Eval(Container.DataItem,"FName")%></td> <td width="25%"><input type=text ...
1
by: Nathan Sokalski | last post by:
I am trying to set the CommandArgument property of a Button control from a template in a DataList of mine using code in the ItemDataBound event. However, it does not want to set the property (it is...
1
by: Arielle | last post by:
Background: I have a generated datalist to display information and I need to add the capability to have a button (Edit button) so that users can change the information. I'm sure once I figure it...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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
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
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...

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.