how to add single select radio button in datagrid... URGENT

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default how to add single select radio button in datagrid... URGENT

    Hi All,
    I am adding a radiobutton in a datagrid. Now if I want to select a single radio button I am unable to achieve this. I have tried both RadioButton and HtmlInputRadioButton. Is there any way out.

    Thanks in advance.

    Regards,
    Sriram Mallajyosula
    Sriram Guest

  2. Similar Questions and Discussions

    1. Select button in datagrid
      I have created a datagrid with a select button so that a user can select a particular row. I did this by setting the CommandName="select". And...
    2. Radio Button Group in a Datagrid
      I have a Datagrid that has multiple rows with a Radio Group template item in it. I need to find out if at least one item in the Radio button group...
    3. datagrid select button
      not sure whats happening here - i basically cutnpasted the code from a page that this code works on but the select button is just not firing any...
    4. How to put a full radio button list in each row of datagrid?
      Hello, I have a datagrid where I display images. I want visitors to be able to rate the images on a scale of 1 to 10 by clicking a radio button,...
    5. Select Button In Datagrid not working (VS2003/FW1.1)
      I've got two pages, each displaying a datagrid with a Select button column. With one the Select command is handled in the codebehind and works...
  3. #2

    Default Re: how to add single select radio button in datagrid... URGENT

    search this newsgroup i posted the complete source code for this a couple weeks ago.

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP [url]http://mvp.support.microsoft.com/default.aspx][/url]
    Got tidbits? Get it here... [url]http://tinyurl.com/27cok[/url]
    "Sriram" <msriram@scapevelocity.com> wrote in message news:u%23fx0sWTEHA.2464@TK2MSFTNGP10.phx.gbl...
    Hi All,
    I am adding a radiobutton in a datagrid. Now if I want to select a single radio button I am unable to achieve this. I have tried both RadioButton and HtmlInputRadioButton. Is there any way out.

    Thanks in advance.

    Regards,
    Sriram Mallajyosula
    Alvin Bruney [MVP] Guest

  4. #3

    Default Re: how to add single select radio button in datagrid... URGENT

    Hi Alvin,
    I am unable to find it in the newsgroup. Can you please post the code once again.

    Thanks in advance.
    Regards,
    Sriram Mallajyosula
    "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message news:uPlAKqZTEHA.1732@TK2MSFTNGP09.phx.gbl...
    search this newsgroup i posted the complete source code for this a couple weeks ago.

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP [url]http://mvp.support.microsoft.com/default.aspx][/url]
    Got tidbits? Get it here... [url]http://tinyurl.com/27cok[/url]
    "Sriram" <msriram@scapevelocity.com> wrote in message news:u%23fx0sWTEHA.2464@TK2MSFTNGP10.phx.gbl...
    Hi All,
    I am adding a radiobutton in a datagrid. Now if I want to select a single radio button I am unable to achieve this. I have tried both RadioButton and HtmlInputRadioButton. Is there any way out.

    Thanks in advance.

    Regards,
    Sriram Mallajyosula
    Sriram Guest

  5. #4

    Default Re: how to add single select radio button in datagrid... URGENT

    put this in your item databound event handler

    [snip]
    else if(e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    {
    System.Text.StringBuilder resource = new System.Text.StringBuilder(256);
    Label lbl = (Label)e.Item.FindControl("Dig");
    if(lbl != null)
    {
    resource.Append(e.Item.Cells[1].Text.Trim());
    lbl.Text = "<input type=radio name='samegroup' value='" + resource.ToString() + "'>";
    }
    else
    throw new OutOfMemoryException("Out of memory");


    add a template column to your datagrid and label it Dig either in the designer or in the html page
    <Columns>
    <asp:TemplateColumn HeaderText="Dig">
    <ItemStyle HorizontalAlign="Center"></ItemStyle>
    <ItemTemplate>
    <asp:Label id="Dig" runat="server">Dig</asp:Label>
    </ItemTemplate>
    </asp:TemplateColumn>
    </Columns>

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP [url]http://mvp.support.microsoft.com/default.aspx][/url]
    Got tidbits? Get it here... [url]http://tinyurl.com/27cok[/url]
    "Sriram" <mshyd@hotmail.com> wrote in message news:%23ZvwxNdTEHA.1768@TK2MSFTNGP10.phx.gbl...
    Hi Alvin,
    I am unable to find it in the newsgroup. Can you please post the code once again.

    Thanks in advance.
    Regards,
    Sriram Mallajyosula
    "Alvin Bruney [MVP]" <vapor at steaming post office> wrote in message news:uPlAKqZTEHA.1732@TK2MSFTNGP09.phx.gbl...
    search this newsgroup i posted the complete source code for this a couple weeks ago.

    --
    Regards,
    Alvin Bruney
    [ASP.NET MVP [url]http://mvp.support.microsoft.com/default.aspx][/url]
    Got tidbits? Get it here... [url]http://tinyurl.com/27cok[/url]
    "Sriram" <msriram@scapevelocity.com> wrote in message news:u%23fx0sWTEHA.2464@TK2MSFTNGP10.phx.gbl...
    Hi All,
    I am adding a radiobutton in a datagrid. Now if I want to select a single radio button I am unable to achieve this. I have tried both RadioButton and HtmlInputRadioButton. Is there any way out.

    Thanks in advance.

    Regards,
    Sriram Mallajyosula
    Alvin Bruney [MVP] Guest

Posting Permissions

  • You may not post new threads
  • You may 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