473,692 Members | 2,103 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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">
<EditItemTempla te>
<table>
<tr>
<td>Active:</td>
<td>
<asp:RadioButto nList ID="optActive" runat="server">
<asp:ListItem Value="1" Text="Yes" />
<asp:ListItem Value="0" Text="No" />
</asp:RadioButton List>
</td>
</tr>
</table>
</EditItemTemplat e>
</asp:FormView>

Thank you!
Tim

Apr 28 '06 #1
2 6997
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*@discussion s.microsoft.com > wrote in message
news:52******** *************** ***********@mic rosoft.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">
<EditItemTempla te>
<table>
<tr>
<td>Active:</td>
<td>
<asp:RadioButto nList ID="optActive" runat="server">
<asp:ListItem Value="1" Text="Yes" />
<asp:ListItem Value="0" Text="No" />
</asp:RadioButton List>
</td>
</tr>
</table>
</EditItemTemplat e>
</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*@discussion s.microsoft.com > wrote in message
news:52******** *************** ***********@mic rosoft.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">
<EditItemTempla te>
<table>
<tr>
<td>Active:</td>
<td>
<asp:RadioButto nList ID="optActive" runat="server">
<asp:ListItem Value="1" Text="Yes" />
<asp:ListItem Value="0" Text="No" />
</asp:RadioButton List>
</td>
</tr>
</table>
</EditItemTemplat e>
</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
1762
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 to be binded to the radiobutton list. I am not able to bind the datareader to the radiobuttonlist control as it is within the Itemtemplate. I am new to .Net. Could someone please let me know what I should be
8
6180
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& number, NumberFormatInfo info, Boolean parseDecimal) +2178925" This is beacuse some of my TextBoxes are empty (no value). If I enter a value it is OK. I need to use Null values to indicate that the field is not fileld in.
1
1268
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 = (Me.FormView1.lengthTextBox.text * 2) this shows an error of couse, what is the new correct way to do this using MS formview data control?
4
12089
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%; text-align:center;"> <asp:RadioButton id="rbn01Approved" runat="server"
3
9163
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 really had any success. I'm pretty sure I should be casting my XPathSelect() call to something so I can get at its attributes. This seems like it should be easy, and maybe I'm missing something obvious. Does anyone have any ideas? Here is the...
2
2769
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 all can address to help me understand events with these better. I've been reading up on inserted/inserting also deleted/deleting, but where is it better to run call those events from via formview or datasource? Also, I have been trying to...
0
1988
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 few questions and hopefully you can provide me some answers. 1. Best place for DataBinding. Where is the best place for calling DataBind method? Is it possible to say don't bind controls for this postback and use current values instead? These...
8
11966
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 which is not a string, for example a custom type Address which contains properties such as StreetAddress, City, County, Country etc how do i bind to those properties on the same form view? I have tried doing Bind("Address.StreetAddress") but...
2
4503
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. Basically the FormView cannot find the TextBoxes inside the tab container's tab panels. Some of the forums say that it's because of the TabContainer's implementation (by design) of "INamingContainer", and a hack is to take control of the TabContainer's...
0
8540
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
8963
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
8803
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
8806
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
7629
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...
1
6459
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5820
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4324
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...
2
2241
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.