DataForm and 2nd Level Object Binding in WPF

2 posts, 0 answers
  1. Ondrej
    Ondrej avatar
    3 posts
    Member since:
    Apr 2012

    Posted 05 Jun 2013 Link to this post

    I found this article without answer. I have the same problem can anybody help me?

    I am using Telerik's WPF controls. In particular the DataForm control. I am trying to bind it to an object that has the following make up.

    public class FrequencyMap : BindableBase
    {
        private Guid id;
    
        public Guid ID
        {
            get { return id; }
            set
            {
                id = value;
                OnPropertyChanged();
            }
        }
    
        private string procedureCodeId;
    
        public string ProcedureCodeId
        {
            get { return procedureCodeId; }
            set
            {
                procedureCodeId = value;
                OnPropertyChanged();
            }
        }
    
        private FrequencyChoice frequency;
    
        public FrequencyChoice Frequency
        {
            get { return frequency; }
            set
            {
                frequency = value;
                OnPropertyChanged();
            }
        }
    
        private DateTime effectiveDate;
    
        public DateTime EffectiveDate
        {
            get { return effectiveDate; }
            set
            {
                effectiveDate = value;
                OnPropertyChanged();
            }
        }
    
        private DateTime? terminateDate;
    
        public DateTime? TerminateDate
        {
            get { return terminateDate; }
            set
            {
                terminateDate = value;
                OnPropertyChanged();
            }
        }
    }
    

    and then the FrequencyChoice object looks like this:

        public class FrequencyChoice : BindableBase
    {
        private int id;
    
        private string modifiedUser;
    
        public int ID
        {
            get { return id; }
            set
            {
                id = value; OnPropertyChanged();
            }
        }
    
        private string code;
    
        public string Code
        {
            get { return code; }
            set
            {
                code = value; OnPropertyChanged();
            }
        }
    
        private string name;
    
        public string Name
        {
            get { return name; }
            set
            {
                name = value; OnPropertyChanged();
            }
        }
    
        private string description;
    
        public string Description
        {
            get { return description; }
            set
            {
                description = value; OnPropertyChanged();
            }
        }
    
        private string calculationDescription;
    
        public string CalculationDescription
        {
            get { return calculationDescription; }
            set
            {
                calculationDescription = value; OnPropertyChanged();
            }
        }
    
        private DateTime inactiveDate;
    
        public DateTime InactiveDate
        {
            get { return inactiveDate; }
            set
            {
                inactiveDate = value; OnPropertyChanged();
            }
        }
    
        public string ModifiedUser
        {
            get
            {
                return this.modifiedUser;
            }
            set
            {
                this.modifiedUser = value;
                OnPropertyChanged();
            }
        }
    
    }
    

    This works quite well except for the Frequency property. How do I get that to work properly(I need name property to be in drop down list box for choose). Do I have to use an Enum like this article? Data Forms in your XAML If so how would I link the two?

    Thank you for your help.
    Ondrej

  2. Maya
    Admin
    Maya avatar
    4062 posts

    Posted 05 Jun 2013 Link to this post

    Hi Ondrej,

    Please check out this article for a reference. 

    Regards,
    Maya
    Telerik

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
Back to Top