Professional Web Applications Themes

how to add single select radio button in datagrid... URGENT - ASP.NET Data Grid Control

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...

  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. #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" <msriramscapevelocity.com> wrote in message news:u%23fx0sWTEHA.2464TK2MSFTNGP10.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

  3. #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.1732TK2MSFTNGP09.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" <msriramscapevelocity.com> wrote in message news:u%23fx0sWTEHA.2464TK2MSFTNGP10.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

  4. #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" <mshydhotmail.com> wrote in message news:%23ZvwxNdTEHA.1768TK2MSFTNGP10.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.1732TK2MSFTNGP09.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" <msriramscapevelocity.com> wrote in message news:u%23fx0sWTEHA.2464TK2MSFTNGP10.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

Similar Threads

  1. Select button in datagrid
    By Jeronimo Bertran in forum ASP.NET Data Grid Control
    Replies: 11
    Last Post: November 15th, 04:39 AM
  2. DataGrid Select Button Event not fired
    By sathya in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: October 21st, 03:15 PM
  3. Radio Button Group in a Datagrid
    By Paul D. Fox in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: August 8th, 06:42 PM
  4. datagrid select button
    By mark in forum ASP.NET Data Grid Control
    Replies: 2
    Last Post: April 28th, 12:37 PM
  5. How to put a full radio button list in each row of datagrid?
    By John Smith in forum ASP.NET Data Grid Control
    Replies: 1
    Last Post: August 20th, 12:27 AM

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