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.
VIEW MODEL
public class EditableViewModel : ReactiveObject
{
public EditableModel SelectedEntity { get; set; }
public List<JobModel> Collection { get; set; }
}
Models
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; }
}
VIEW
<reactiveui:ReactiveWindow
x:Class="TestWpfApplication.MainWindow"
x:TypeArguments="test:EditableViewModel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:test="clr-namespace:TestWpfApplication.ViewModels"
xmlns:reactiveui="http://reactiveui.net"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
Title="NuGet Browser" Height="450" Width="800"
mc:Ignorable="d">
<Grid>
<Grid.Resources>
<DataTemplate x:Key="MyTemplate">
<StackPanel>
<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}"/>
</StackPanel>
</DataTemplate>
</Grid.Resources>
<telerik:RadDataForm AutoGenerateFields="False" x:Name="RadDataForm" EditTemplate="{StaticResource MyTemplate}"/>
</Grid>
</reactiveui:ReactiveWindow>