Hillquinymn
New Member
I need to dynamically create multiple RadiobuttonLists in the code behind which I have no problem with. But on top of that, certain ListItems in each RadiobuttonList should also have a textbox next to it.E.g.[] option1 [] option2 [TEXTBOX][] option3[] option4 [TEXTBOX]I have a SQL table which tells me each of the items to display in each RadiobuttonList, as well as whether they require a textbox.How do I go about creating these textboxes in code behind?I have this so far within a loop:\[code\]string cmd = "select * from mytable where P_NO = " + myvalue.ToString(); SqlCommand command1 = new SqlCommand(cmd, conn); SqlDataAdapter adapter1 = new SqlDataAdapter(command1); adapter1.Fill(dt1); if (dt1.Rows.Count > 0) { for (int i = 0; i < dt1.Rows.Count; i++) { radioOption.Items.Add(new ListItem(dt1.Rows[9].ToString(), dt1.Rows[8].ToString())); } }\[/code\]I know there are a few threads regarding this, but all of them requires only 1 textbox (next to 'Other') and are not required to be done dynamically.Any ideas?!