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

Binding Enum To DataFormComboBoxField

1 Answer 137 Views
DataForm
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Geoffrey
Top achievements
Rank 1
Geoffrey asked on 28 Jun 2012, 08:01 PM
I'm trying to bind an enum to a DataFormComboBoxField but I'm having trouble. I can load the combo box with the items from the enum but I can't set the Selected Item. What am I doing wrong? Here the AccountType is my enum and AccountTypesSource is just the result of a telerik EnumDataSource
<telerik:DataFormComboBoxField  
  SelectedValuePath="AccountType"
  DataMemberBinding="{Binding AccountType, Mode=TwoWay}"
  ItemsSource="{Binding AccountTypesSource}" />

 

public EnumDataSource AccountTypesSource
{
    get
    {
  return new EnumDataSource { EnumType = typeof(AccountTypes) };
    }
}

1 Answer, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 29 Jun 2012, 06:46 AM
Hello Geoffrey,

You can define DataTemplate with RadComboBox inside and bind its SelectedValue/ SelectedItem. Please take a look at this forum thread for a reference.
 

Kind regards,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

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