Problem: Binding a datatable to RadioButtonList inside a DataGrid

A

Andy

Hi, I would like to do this (see below) but keep getting error. Any
help is appreciated. thanks.

I have a datagrid which display a search from a product catalog table
in the database. I want to add the RadioButtonList in the first column
of this DataGrid (as follow) so that when user click on the radio
button on the first column, that row in the datagrid is selected. The
selection part is working fine. The problem I am having is the binding
to the RadioButtonList. I want to use the same data source that binds
the datagrid to bind the RadioButtonList. Meaning for each row in the
datagrid the the radio button (ListItem) binds to one column in the
data table (say product_id from product catalog table). Why do I want
to do that? because I have a set of action (update, delete, check-in,
check-out..) in button and as user select a radio button from the
datagrid he/she can click on a button to go to a page to perform an
action. To do this I need to know what radio button is selected.

<asp:TemplateColumn>
<HeaderStyle HorizontalAlign="Center"></HeaderStyle>
<ItemTemplate>
<asp:RadioButtonList ID="rdActionList"
OnSelectedIndexChanged="RadioButton_Selected" AutoPostBack="True"
Runat="server"></asp:RadioButtonList>
</ItemTemplate>
</asp:TemplateColumn>

Thanks a lot.
 

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,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top