Professional Web Applications Themes

RadioButtonList within DataGrid - ASP.NET Data Grid Control

Hi. I'm trying to make a datagrid with a RadioButtonList on each row: <asp:TemplateColumn HeaderText="Action"> <ItemTemplate> <asp:RadioButtonList runat="server"> <asp:listitem runat="server" value="stop" /> <asp:listitem runat="server" value="go" /> </asp:radiobuttonlist> </ItemTemplate> </asp:TemplateColumn> I want to be able to associate each button list with the row's ID field from the data source, so on postback I can determine the selected action that relates to that ID. The problem is I don't understand how to access the selected values. Can anyone help? Mike...

  1. #1

    Default RadioButtonList within DataGrid

    Hi.

    I'm trying to make a datagrid with a RadioButtonList on each row:

    <asp:TemplateColumn HeaderText="Action">
    <ItemTemplate>
    <asp:RadioButtonList runat="server">
    <asp:listitem runat="server" value="stop" />
    <asp:listitem runat="server" value="go" />
    </asp:radiobuttonlist>
    </ItemTemplate>
    </asp:TemplateColumn>

    I want to be able to associate each button list with the row's ID field
    from the data source, so on postback I can determine the selected action
    that relates to that ID.

    The problem is I don't understand how to access the selected values.
    Can anyone help?

    Mike
    Mike Chamberlain Guest

  2. #2

    Default Re: RadioButtonList within DataGrid

    Assign an ID to the RadioButtonList. Then in your event handler (like the
    DataGrid's ItemCommand) you should have access to the DataGridItem (essentially
    the row in the datagrid) and you just need to call FindControl("YourIDForTheRadioButtonList").

    -Brock
    DevelopMentor
    [url]http://staff.develop.com/ballen[/url]


    > Hi.
    >
    > I'm trying to make a datagrid with a RadioButtonList on each row:
    >
    > <asp:TemplateColumn HeaderText="Action">
    > <ItemTemplate>
    > <asp:RadioButtonList runat="server">
    > <asp:listitem runat="server" value="stop" />
    > <asp:listitem runat="server" value="go" />
    > </asp:radiobuttonlist>
    > </ItemTemplate>
    > </asp:TemplateColumn>
    > I want to be able to associate each button list with the row's ID
    > field from the data source, so on postback I can determine the
    > selected action that relates to that ID.
    >
    > The problem is I don't understand how to access the selected values.
    > Can anyone help?
    >
    > Mike
    >


    Brock Allen Guest

Similar Threads

  1. RadioButtonList In DataGrid
    By Greg Wold in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: February 25th, 07:03 PM
  2. RadioButtonList In DataGrid (edited e-mail address)
    By in forum ASP.NET Data Grid Control
    Replies: 0
    Last Post: June 24th, 07:17 PM
  3. Retrieving radiobuttonlist from datagrid
    By Shailesh Jannu in forum ASP.NET Building Controls
    Replies: 0
    Last Post: April 30th, 12:24 AM
  4. Datagrid - dynamic radiobuttonlist problems...
    By Michael Christensen in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: October 7th, 08:24 AM
  5. RadioButtonList in Nested DataGrid Problem
    By Bob Hoke in forum ASP.NET General
    Replies: 0
    Last Post: July 11th, 06:28 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139