Quote:
Originally Posted by Venkat hi rajesh,
I have implemented the DataBinder i got the primary key and reterived all the information in nested repeater it working excellently. In this repeater i have to insert a radio button which i have done it. I am not getting the ID of the radio button in the code behind of the nested repeater can you help me....
<table>
<tr>
<td> </td>
<td> <asp:RadioButtonList ID="personalityOptionRadioButtonList" runat="server" Width="100%" BorderWidth="0px" RepeatColumns="1" CssClass="text3" DataSource='<%#getPersonalityOption(DataBinder.Eva l(Container.DataItem,"Id"))%>' DataValueField="Id" DataTextField="Name"> </asp:RadioButtonList>
<asp:Label runat="server" ID="emptyOptionsLabel" Visible="false" CssClass="text3" Text="No options move to next question."></asp:Label>
</td>
</tr>
</table> |
hi
To get the Id of RadioButoon. In side the Databound event of gridview find the Repeater first then do the bellow coding. (just check out the comments which have been marked in red)
foreach (RepeaterItem j in personalityQuestionRepeater.Items)
{
questionId = short.Parse(((System.Web.UI.WebControls.Label)j.Fi ndControl("personalityQuestionIdLabel")).Text);
if (personalityOptionRadioButtonList != null)
{
if (personalityOptionRadioButtonList.Items.Count > 0)
{
for (int k = 0; k < personalityOptionRadioButtonList.Items.Count; k++)
{
//optionId will get the radioButton id For each cycle in
// personalityOptionRadioButtonList.Items.Count
optionId = short.Parse(personalityOptionRadioButtonList.Items[k].Value.ToString());