Binding to object data source with nested collection

2 posts, 0 answers
  1. murthy
    murthy avatar
    1 posts
    Member since:
    Aug 2010

    Posted 03 Aug 2010 Link to this post

    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


  2. Developer
    Developer avatar
    16 posts
    Member since:
    Jun 2009

    Posted 08 Oct 2010 Link to this post

    Got the same problem. Any help please?

    Regards.
Back to Top