Binding RadComboBox with ObjectDataSource trough DataValueField="Property.Property"

2 posts, 0 answers
  1. Carlos Fernando
    Carlos Fernando avatar
    1 posts
    Member since:
    Jun 2014

    Posted 22 Jun 2014 Link to this post

    Hi, I'm trying to bind a RadComboBox with an ObjectDataSource (odsFuenteEmisionAlcance) that returns a List of Objects like these:

    public class FuenteEmisionAlcance
        private FuenteEmision m_FuenteEmision;
        private Alcance m_Alcance;
        public FuenteEmision FuenteEmision
            get { return m_FuenteEmision; }
            set { m_FuenteEmision = value; }
        public Alcance Alcance
            get { return m_Alcance; }
            set { m_Alcance = value; }

    This is my ComboBox

    <telerik:RadComboBox ID="rcbFuenteEmision" runat="server" AutoPostBack="True" DataSourceID="odsFuenteEmisionAlcance" DataTextField="FuenteEmision.Nombre" DataValueField="FuenteEmision.Id" ZIndex="100000" CausesValidation="False" OnSelectedIndexChanged="rcbFuenteEmision_SelectedIndexChanged" EmptyMessage="--Seleccione--" OnClientSelectedIndexChanged="OnClientSelectedIndexChanged" OnDataBinding="rcbFuenteEmision_DataBinding"></telerik:RadComboBox>

    I'm trying to use the DataTextField and DataValueField values from the Property FuenteEmision, but somehow is not getting it, this is what I get:

    [NotSupportedException: Object of type HUC.FuenteEmisionAlcance does not have a FuenteEmision.Nombre property.]

    Like I show before the object FuenteEmisionAlcance does a have a FuenteEmision property, the combo is able to find it, i've tried using only DataTextField="FuenteEmision" and DataValueField="FuenteEmision" just to try and it does find it, but when it comes to find a property from the property it crashes, is this impossible? or there is another way I can acomplish this.

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 23 Jun 2014 in reply to Carlos Fernando Link to this post

    Hi Carlos Fernando,

    Please have a look into this help documentation and online demo which shows binding of RadComboBox using ObjectDataSource. Please provide your full code if it doesn't help.

  3. DevCraft R3 2016 release webinar banner
Back to Top