RadioButtonList not grouping...

Discussion in '.NET' started by AlbertM., Apr 13, 2008.

  1. AlbertM.

    AlbertM.

    Joined:
    Apr 2, 2008
    Messages:
    3
    Hi there,

    I have a asp:RadioButtonList inside a Repeater and it is working fine except that they are not grouping. I tried GroupName and nothing happens.

    Here's my back end code:

    void Question(){
    OleDbDataAdapter objDAque;
    OleDbDataAdapter objDAopt;

    DataSet objDS = new DataSet(); // create a recordset empty

    objConn.Open();
    objDAque = new OleDbDataAdapter("SELECT * FROM simulado_question", objConn); //execute the query
    objDAque.Fill(objDS, "question");


    objDAopt = new OleDbDataAdapter("SELECT * FROM simulado_option", objConn);
    objDAopt.Fill(objDS, "option");


    DataRelation rel = new DataRelation("joinQueOpt", objDS.Tables["question"].Columns["id_ques"] , objDS.Tables["option"].Columns["id_ques"]);
    objDS.Relations.Add(rel);


    dlQues.DataSource = objDS.Tables["question"].DefaultView;
    dlQues.DataBind();

    objConn.Close();

    }




    void R1_ItemDataBound(Object Sender, RepeaterItemEventArgs e) {

    if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
    {

    ((Repeater)e.Item.FindControl("dlOption")).DataSource=((DataRowView)e.Item.DataItem).CreateChildView("joinQueOpt");
    ((Repeater)e.Item.FindControl("dlOption")).DataBind();
    }

    }



    And the Controlers:

    <asp:Repeater ID="dlQues" runat="server" OnItemDataBound="R1_ItemDataBound" >
    <itemtemplate>
    <%# DataBinder.Eval(Container.DataItem, "question")%>

    <asp:Repeater ID="dlOption" runat="server" >
    <itemtemplate>

    <asp:RadioButtonList ID="rblOption" Runat="server" DataTextField="option" DataValueField="id_opt"/>

    </itemtemplate>
    </asp:Repeater>

    </itemtemplate>
    </asp:Repeater>


    Anyone can help?
    Thanks...
     
    Last edited: Apr 14, 2008
    AlbertM., Apr 13, 2008
    #1
    1. Advertising

  2. AlbertM.

    AlbertM.

    Joined:
    Apr 2, 2008
    Messages:
    3
    I am still having issues with the RadioButtonList. I'm not sure how to pull and group the radiobutton items from the DataSet.

    Any suggestions? I'm pulling my hair over here. I know it's a quick fix... but I just can't figure it out.
     
    AlbertM., Apr 14, 2008
    #2
    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. JemPower
    Replies:
    0
    Views:
    677
    JemPower
    Aug 29, 2003
  2. Tim
    Replies:
    1
    Views:
    1,930
    William F. Robertson, Jr.
    Nov 11, 2003
  3. Mervin Williams

    RadioButtonList SelectedIndexChanged() not firing

    Mervin Williams, May 4, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    4,841
    Mervin Williams
    May 5, 2004
  4. Chris

    Panel css not grouping controls

    Chris, Jan 11, 2007, in forum: ASP .Net
    Replies:
    1
    Views:
    347
  5. Virtual Buddha
    Replies:
    3
    Views:
    353
    Virtual Buddha
    Jun 27, 2009
Loading...

Share This Page