I´m trying to use a data list control to display radio buttons inside the
template of the control but the data list control change the name of the radio buttons.
using this event works fine when bindng data into the radio buttons, but the data list still changing the name of the radios.
I tried to set the GroupName oh the radio buttons but nothing happens
they dont get grouped!!!
private void DlTarifas_ItemDataBound(object sender, System.Web.UI.WebControls.DataListItemEventArgs e) {
RadioButton Radio = (RadioButton)e.Item.FindControl("RATES");
Radio.GroupName ="RATES";
Radio.Text = (this.I).ToString();
this.I += 1;
}
this is what is rendered:
<table id="DlTarifas" cellspacing="0" border="0" style="width:237px;border-collapse:collapse;">
<tr>
<td>
<TABLE id="Table1" cellSpacing="5" cellPadding="0" width="100%" border="0">
<TR>
<TD class="TituloTarifa">
<span id="DlTarifas__ctl0_TITULO_TARIFA" class="TituloTarifa">ESPECIAL KM LIVRE</span></TD>
</TR>
<TR>
<TD class="DescTarifa">
<span class="DescTarifa"><input id="DlTarifas__ctl0_TARIFA" type="radio" name="DlTarifas:_ctl0:TARIFAS_AG" value="TARIFA" /><label for="DlTarifas__ctl0_TARIFA">0</label></span></TD>
</TR>
........
........