RadioButtonList not grouping...

Joined
Apr 2, 2008
Messages
3
Reaction score
0
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:
Joined
Apr 2, 2008
Messages
3
Reaction score
0
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,056
Latest member
GlycogenSupporthealth

Latest Threads

Top