FormView - RadioButtonList binding


G

Guest

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
 
Ad

Advertisements

C

Clickon

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
 
Ad

Advertisements

G

Guest

I am using the FormView control, not the GridView. And yes, I have a
SqlDataSource control bound to the FormView.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top