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

DataForm and 2nd Level Object Binding in WPF

1 Answer 57 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
Ondrej
Top achievements
Rank 1
Ondrej asked on 05 Jun 2013, 07:10 AM

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

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 05 Jun 2013, 07:15 AM
Hi Ondrej,

Please check out this article for a reference. 

Regards,
Maya
Telerik

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
DataForm
Asked by
Ondrej
Top achievements
Rank 1
Answers by
Maya
Telerik team
Share this question
or