Problem: Binding a datatable to RadioButtonList inside a DataGrid

Discussion in 'ASP .Net Building Controls' started by Andy, Mar 6, 2006.

  1. Andy

    Andy Guest

    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.
     
    Andy, Mar 6, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Luis Esteban Valencia

    Radiobuttonlist events INSIDE a datagrid?

    Luis Esteban Valencia, Jan 5, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    539
    Luis Esteban Valencia
    Jan 5, 2005
  2. Luis Esteban Valencia
    Replies:
    0
    Views:
    732
    Luis Esteban Valencia
    Jan 5, 2005
  3. pmclinn
    Replies:
    0
    Views:
    5,387
    pmclinn
    Jun 22, 2006
  4. quiggle

    Binding Two DataTable Columns to One DataGrid Column

    quiggle, Apr 2, 2004, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    197
    quiggle
    Apr 2, 2004
  5. Replies:
    4
    Views:
    216
    chotchkie
    Dec 30, 2004
Loading...

Share This Page