473,413 Members | 1,737 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,413 software developers and data experts.

FormView - RadioButtonList binding

Tim
I have a radio button list control in the edit item template of a formview,
as below. I want to bind this to a bit field from my sql database, however I
can't seem to figure it out. Could some please provide me assistance on how
to do this?
<asp:FormView ID="FormView1" runat="server">
<EditItemTemplate>
<table>
<tr>
<td>Active:</td>
<td>
<asp:RadioButtonList ID="optActive" runat="server">
<asp:ListItem Value="1" Text="Yes" />
<asp:ListItem Value="0" Text="No" />
</asp:RadioButtonList>
</td>
</tr>
</table>
</EditItemTemplate>
</asp:FormView>

Thank you!
Tim

Apr 28 '06 #1
2 6974
Well the first thing you need is a datasource to bind the gridview to. If
you are using SQL server your could use the SQLDataSource control. Once you
have done that post back and i will tel you how to bind the data source to
the GridView

"Tim" <Ti*@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
I have a radio button list control in the edit item template of a formview,
as below. I want to bind this to a bit field from my sql database, however
I
can't seem to figure it out. Could some please provide me assistance on
how
to do this?
<asp:FormView ID="FormView1" runat="server">
<EditItemTemplate>
<table>
<tr>
<td>Active:</td>
<td>
<asp:RadioButtonList ID="optActive" runat="server">
<asp:ListItem Value="1" Text="Yes" />
<asp:ListItem Value="0" Text="No" />
</asp:RadioButtonList>
</td>
</tr>
</table>
</EditItemTemplate>
</asp:FormView>

Thank you!
Tim

Apr 28 '06 #2
Tim
I am using the FormView control, not the GridView. And yes, I have a
SqlDataSource control bound to the FormView.

Thanks.
"Clickon" wrote:
Well the first thing you need is a datasource to bind the gridview to. If
you are using SQL server your could use the SQLDataSource control. Once you
have done that post back and i will tel you how to bind the data source to
the GridView

"Tim" <Ti*@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
I have a radio button list control in the edit item template of a formview,
as below. I want to bind this to a bit field from my sql database, however
I
can't seem to figure it out. Could some please provide me assistance on
how
to do this?
<asp:FormView ID="FormView1" runat="server">
<EditItemTemplate>
<table>
<tr>
<td>Active:</td>
<td>
<asp:RadioButtonList ID="optActive" runat="server">
<asp:ListItem Value="1" Text="Yes" />
<asp:ListItem Value="0" Text="No" />
</asp:RadioButtonList>
</td>
</tr>
</table>
</EditItemTemplate>
</asp:FormView>

Thank you!
Tim


Apr 28 '06 #3

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

Similar topics

0
by: ani | last post by:
Hi, I have a datalist control and within the Itemplate I have a radiobuttonlist control . I am binding data to the datalist control in Page_load . Also I have sqldatareader object that needs...
8
by: Ottar | last post by:
I have a few numeric fields, and when I update i get the error: "Input string was not in a correct format". Next line:" System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer&...
1
by: TdarTdar | last post by:
I wanted to add three columns up on the form and run some logic to fill in the third but not sure how to call the field names in the formview control. Dim Girth As Integer Elenght =...
4
by: sck10 | last post by:
Hello, I am trying to use a radiobutton inside of a FormView for editing data. My question is how do you bind the radio buttons to the data field? Thanks, sck10 <td style="width:30%;...
3
by: Brian | last post by:
Using external XML, I'm trying to build a quiz, but I can't seem to specify the DataSource for the RadioButtonList within a Repeater ItemTemplate. I've tried a number of approaches, but I haven't...
2
by: Kelly | last post by:
I'm fairly new to ASP.NET2, but I have an ASP 3.0 background, and I've been experimenting with the DataSource and FormView widgets. I wound up having some questions along the way which I hope you...
0
by: =?Utf-8?B?TGFkaXNsYXYgTXJua2E=?= | last post by:
Hello, I read some msdn and other articles about how does databinding among DataSource controls and FormView / GridView controls works but I still don't fully understand to this blackbox. I have...
8
by: =?Utf-8?B?QXNo?= | last post by:
Hi, I have an object, for example User. User contains various properties which i have been able to bind to successfully using wizards and the form view. However if the class User has a property...
2
by: =?Utf-8?B?Q29sb3JzdG9uZQ==?= | last post by:
Hi, I have a TabContainer inside a data bound FormView (to logically group the form fields into different tabs). The display part of the data binding works fine, but the Update doesn't. ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
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...
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
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
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
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...

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.