Issues with DataFormComboBoxField binding

3 posts, 0 answers
  1. David
    David avatar
    2 posts
    Member since:
    Mar 2019

    Posted 14 Mar Link to this post

    Hi guys,

    I am having some issues with binding the DataFormComboBoxField.  I am setting the item source of the comboboxfield to a collection that is not stored in the CurrentItem of the RadDataForm.  I wish to update the EditableModel with the JobID from the selected drop down value.  Also the Combobox should have the item selected base on the item set in the EditableModel on load.  Any help would be appreciated.  



        public class EditableViewModel : ReactiveObject
            public EditableModel SelectedEntity { get; set; }
            public List<JobModel> Collection { get; set; }



        public class EditableModel

            public string Name { get; set; }
            public int JobId { get; set; }

        public class JobModel
            public string Name { get; set; }
            public int Id { get; set; }


        Title="NuGet Browser" Height="450" Width="800"
                <DataTemplate x:Key="MyTemplate">
                        <telerik:DataFormDataField  Label="First Name" DataMemberBinding="{Binding Path=Name, Mode=TwoWay}"  />
                        <telerik:DataFormComboBoxField  Label="Job" SelectedValuePath="Id" DisplayMemberPath="Name" DataMemberBinding="{Binding JobId, Mode=TwoWay}" ItemsSource="{Binding Jobs, Mode=TwoWay}"/>
            <telerik:RadDataForm AutoGenerateFields="False" x:Name="RadDataForm" EditTemplate="{StaticResource MyTemplate}"/>


  2. David
    David avatar
    2 posts
    Member since:
    Mar 2019

    Posted 14 Mar in reply to David Link to this post

    Sorry the collection properties should be Jobs
  3. Vladimir Stoyanov
    Vladimir Stoyanov avatar
    476 posts

    Posted 19 Mar Link to this post

    Hello David,

    Thank you for the provided code snippet. 

    May I kindly ask you to elaborate a bit on the described scenario? Can you share what is the ItemsSource/CurrentItem of the RadDataForm set to? Additionally, can you elaborate a bit on the need for the different classes JobModel and EditableModel? If there isn't a need for both of them, perhaps you can simplify the data representation and use only one class. 

    If possible, you can prepare a small sample project demonstrating your scenario and send it over in a new support ticket. This will hopefully allow us to check out the scenario and better assist you.

    Thank you in advance for any help you can provide. 

    Vladimir Stoyanov
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top