This is a migrated thread and some comments may be shown as answers.

Binding to object data source with nested collection

1 Answer 102 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
murthy
Top achievements
Rank 1
murthy asked on 03 Aug 2010, 05:16 PM
Hi,
 I have an object with hierarchy displayed below, and I need to bind to this using declarative binding in the ASPX page.

RootObject
   I_ StreetNames (collection)
          I_StreetID
  I_StreetName

Now I need to bind the DataTextField to StreetName and DataValueField to StreetID

Due to our architecture constraint I need to use object data source only. I would like to do a declarative binding.

I had tried the following options
ID="cboStreetName" DataSource='<%# Eval("StreetNames") %>' DataTextField="StreetName" DataValueField="StreetID" with the error
 Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control

DataSource='<%# DataBinder.Eval(Container,"StreetNames") %>' DataTextField="StreetName" DataValueField="StreetID"> with error
ASP.xxx_aspx' does not contain a property with the name 'StreetNames'

I am new to ASP.NET as well as Telerik Combobox.
I am working in ASP.NET 2.0 in Win XP enviroment.

Thanks in Advance
Murthy Meka


1 Answer, 1 is accepted

Sort by
0
Developer
Top achievements
Rank 1
answered on 08 Oct 2010, 10:45 AM
Got the same problem. Any help please?

Regards.
Tags
ComboBox
Asked by
murthy
Top achievements
Rank 1
Answers by
Developer
Top achievements
Rank 1
Share this question
or