Dropdown list in a repeater?

D

Darren Clark

Is it possible to nest a drop down list in a repeater? (also the repeater has a nested repeater)

The code i am using looks like.... i get an error saying that
Exception Details: System.Web.HttpException: DataBinder.Eval: 'System.Data.DataRow' does not contain a property with the name topic.

If i remove the dropdown list code it works fine...

Any ideas?

<asp:Repeater ID="SectionRepeater" Runat="server">
<ItemTemplate>
<div>
<p class="section_text"><%# DataBinder.Eval(Container,"DataItem."+ JR.Core.Data.QuestionData.FLD_SECTION_NAME) %>
<asp:DropDownList ID="SectionDropDown" DataSource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("myquestions") %>'
DataValueField="ques_id" DataTextField="topic" Runat=server></asp:DropDownList>
</p>
<!-- start child repeater -->
<asp:repeater id="QuestionsForSections" datasource='<%# ((DataRowView)Container.DataItem).Row.GetChildRows("myquestions") %>' runat="server">
<itemtemplate>
<span class="question_text">
<%# DataBinder.Eval(Container.DataItem, "[\"topic\"]")%>
</span><br>
<span class="body_text">
<%# DataBinder.Eval(Container.DataItem, "[\"body\"]")%>
</span>
<br>
<br>
</itemtemplate>
</asp:repeater>
<!-- end child repeater -->
</div>
</ItemTemplate>
</asp:Repeater>
 

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,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top