Bind data declaratively to RadioButtonList

P

papaja

I have gollowing code:

<asp:Repeater ID="Repeater1" runat="server">

<ItemTemplate>

<asp:Label ID="Label1" runat="server" Text='<%#Eval("Pitanje")
%>'></asp:Label>

<asp:RadioButtonList ID="rblOdgovori" runat="server" DataSourceID='<%
PristupRezultatima.DajOdgovoreNaPitanje(Eval("PitanjeID")) %>'
DataTextField='<%#Eval("Odgovor") %>'
DataValueField='<%#Eval("OdgovorID") %>'>
</asp:RadioButtonList>

</ItemTemplate>

</asp:Repeater>

I set DataSource of Repeater1 in code behind file. I tried to set
DataSource to RadioButtonList the way I showed in code. I tried to call
method DajOdgovoreNaPitanje from class PristupRezultatima. This method
requires parameter "PitanjeID". So I tried passing this value using
Eval("PitanjeID").

DataSource of Repeater has column "PitanjeID". Sill, I'm getting error:
DataBinding: 'System.Data.DataRowView' does not contain a property with
the name 'Odgovor'. Where am I wrong?

Procedure DajOdgovoreNaPitanje returns column "Odgovor". Please help
 

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,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top