Having a Radio button one in each column in a Datagrid but belong to the same group?

Discussion in 'ASP .Net Web Controls' started by Satish Appasani, Nov 13, 2003.

  1. Hi:

    I want to develop a page which contains a datagrid and a couple of columns
    in the grid will have radio buttons. All the radio buttons in a row should
    belong to the same group so that when i check one the other is unchecked.

    Any clue on this? Thanks in advance

    Satish
    Satish Appasani, Nov 13, 2003
    #1
    1. Advertising

  2. Satish Appasani

    Alvin Bruney Guest

    You may want to just add the radio button to each cell on the itemcreated
    event handler and then set the group property on each button so that they
    belong to the same family to give you the behavior you are after.

    if (i.itemtype.listit == listitem.alternate or listitem.item)

    radiobutton t = new radiobutton();
    t.GroupName = "onefamily"
    radiobutton tt = new radiobutton();
    rr.GroupName = "onefamily"

    e.item.cells[2].controls.add(t);
    e.item.cells[3].controls.add(t);
    and so on and so forth

    this is rough code, it will not compile, but the approach is correct
    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "Satish Appasani" <> wrote in message
    news:#...
    > Hi:
    >
    > I want to develop a page which contains a datagrid and a couple of columns
    > in the grid will have radio buttons. All the radio buttons in a row should
    > belong to the same group so that when i check one the other is unchecked.
    >
    > Any clue on this? Thanks in advance
    >
    > Satish
    >
    >
    Alvin Bruney, Nov 15, 2003
    #2
    1. Advertising

  3. Satish Appasani

    Nick Hertl Guest

    Have you looked into using a TemplateColumn in your DataGrid? This is a
    very powerful way to generate neet stuff in custom columns.
    You could just set the GroupName to the samething for all the ones you want
    to be linked. And then determine which one is selected in your handler
    function based on either which row in the table its in or some other data
    that you associate with it in the TemplateColumn.
    ----------------
    This posting is provided "AS IS" with no warranties, and
    confers no rights.

    Please do not send e-mail directly to this alias. This
    alias is for newsgroup purposes only.

    Thanks
    Nick

    --------------------
    >From: "Satish Appasani" <>
    >Subject: Having a Radio button one in each column in a Datagrid but belong

    to the same group?
    >Date: Thu, 13 Nov 2003 15:01:38 -0500
    >Lines: 11
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
    >Message-ID: <#>
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webcontrols
    >NNTP-Posting-Host: ddsl-66-161-151-190.fuse.net 66.161.151.190
    >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!tk2msftngp13.phx.gbl
    >Xref: cpmsftngxa06.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webcontrols:16154
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webcontrols
    >
    >Hi:
    >
    >I want to develop a page which contains a datagrid and a couple of columns
    >in the grid will have radio buttons. All the radio buttons in a row should
    >belong to the same group so that when i check one the other is unchecked.
    >
    >Any clue on this? Thanks in advance
    >
    >Satish
    >
    >
    >
    Nick Hertl, Dec 14, 2003
    #3
    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. Patrick Olurotimi Ige

    Column 'link_url' does not belong to table links.

    Patrick Olurotimi Ige, May 5, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    3,224
    Patrick Olurotimi Ige
    May 12, 2005
  2. Krishna
    Replies:
    0
    Views:
    517
    Krishna
    Jul 13, 2006
  3. =?Utf-8?B?TWlrZQ==?=

    Column does not belong to table error

    =?Utf-8?B?TWlrZQ==?=, Sep 6, 2006, in forum: ASP .Net
    Replies:
    13
    Views:
    36,581
    gbulfon
    Aug 18, 2010
  4. Scott D Johnson
    Replies:
    1
    Views:
    1,062
    Scott D Johnson
    Sep 27, 2006
  5. Hiten
    Replies:
    1
    Views:
    616
    Vidar Petursson
    May 26, 2004
Loading...

Share This Page