New to Telerik UI for WPF? Download free 30-day trial

DataForm DataFormComboBoxField SelectedItem Becomes Null After Commit Button Click


Product Version
Product RadDataForm for WPF


The following setup produces a null value in the SelectedItem of the RadDataFormComboBoxField on Commit button click.

<telerik:DataFormComboBoxField DataMemberBinding="{Binding SelectedItem}" 
                               ItemsSource="{Binding Items}" /> 
This happens if the Commit button unloads the control from the visual tree. For example, if hosted in dialog window that gets closed on commit.


To resolve this, add a RadComboBox control directly inside of the Content of the data field.

    <telerik:RadComboBox SelectedItem="{Binding SelectedItem}"  
                         ItemsSource="{Binding Items}"  /> 
In this article