RadioButtonList(HTML) Control in a GridView

  • Thread starter Andy in South Jersey
  • Start date
A

Andy in South Jersey

I want to use a RadioButtonList Control(HTML) in a GridView control.

I can see the RadioButtonList control with each row in the GridView with the
code:

<asp:GridView ID="GridView1" runat="server"
AutoGenerateColumns="False" DataKeyNames="Question_id"
DataSourceID="SqlDataSource1">
<Columns>
<asp:BoundField DataField="q_Description"
HeaderText="Question" SortExpression="q_Description" />
<asp:BoundField DataField="Answer_id" HeaderText="Answer_id"
SortExpression="Answer_id" />
<asp:TemplateField HeaderText="Level of Helpfulness">
<ItemTemplate>
<asp:RadioButtonList ID="RadioButtonList1"
runat="server" RepeatDirection="Horizontal" SelectedValue='<%#
Bind("Answer_id") %>'>
<asp:ListItem Value="1">None</asp:ListItem>
<asp:ListItem Value="2">Minimal</asp:ListItem>
<asp:ListItem Value="3">Moderate</asp:ListItem>
<asp:ListItem Value="4">Very</asp:ListItem>
<asp:ListItem Value="4">Highly</asp:ListItem>
</asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

Now I want to be able to insert rows in a table and get the value selected
in the RadioButtonList.
 

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

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top