473,394 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Bind data declaratively to RadioButtonList

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("Pita njeID")) %>'
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

Jul 3 '06 #1
0 1346

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Andrew J. Kelly | last post by:
How do you data bind to a group of radio buttons? I can bind to an individual radio button just fine but how do you bind a single field to all the buttons so it works like a Radio button should? ...
0
by: John Grandy | last post by:
Does anyone know of a data object that when bound to a RadioButtonList would properly populate the ListItem.Value and ListItem.Text properties ? I was using a NameValueCollection ... however,...
1
by: kids_pro | last post by:
I tried to create a simple method to bind 3 kind of control private void SimpleBinding(ListControl lc, string tblName, string txtField, string valField){ SqlDataReader dr = .... //... get value...
4
by: Emil | last post by:
Can somebody tell me what would be the syntax for having an if statement and setting the selected index of a radiobuttonlist? This is my first project using ASP.net and I use C#. I have a repeater...
2
by: Serg | last post by:
Hello, I need to set the selection in the RadioButtonList according to the value of SelectedValue in the underlying dataset - please suggest. The code is below. Thank you. <asp:TemplateColumn>...
7
by: Jed | last post by:
I have a web service method that returns an array of custom objects marked serializeable with fully described public properties. When I bind the results to a DataGrid I can access the properties...
4
by: sck10 | last post by:
Hello, I am trying to use a radiobutton inside of a FormView for editing data. My question is how do you bind the radio buttons to the data field? Thanks, sck10 <td style="width:30%;...
0
by: daz_oldham | last post by:
Hi all I have some xml which I have put into an XmlNodeList as a sub-set of some data. I would like to bind this xml to a RadioButton list, giving each radio button values based on attributes...
0
by: Bogdan | last post by:
Hi, I have a wizard control consisting of 3 steps. One of the steps contains a dropdownlist that I'd like to bind as follows: <asp:DropDownList ID="ddlRocks" runat="server" DataSource='<%#...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.