//PROBLEM: Edited text in telerik:GridViewComboBoxColumn fails to write to bound data object using ItemsSource , otherwise works fine.
// The drop down list works fine but when i try to enter some text into the editor it doesn't write to the Path property on my CinemaPackage. In fact it looks like it is trying to bind to 'Path' proerty on my ViewModel
public class CinemaPackage : NotifyPropertyChangedBase
{
private string path;
public CinemaPackage()
{
Paths = new ObservableCollection<string> {"path1", "path2"};
}
public ObservableCollection<string> Paths { get; set; }
public string Path
{
get { return path; }
set
{
path = value;
ViewModelPropertyChanged(this, "Path");
}
}
}
public class TransferPackagesViewModel : ViewModelAppBase, ITransferPackagesViewModel
{
public ObservableCollection<CinemaPackage> CinemaPackages { get; set; }
public TransferPackagesViewModel()
{
CinemaPackages = new ObservableCollection<CinemaPackage>();
}
// this should not be needed here
//private string path;
//public string Path
//{
// get { return path; }
// set
// {
// path = value;
// ViewModelPropertyChanged(this, "Path");
// }
//}
}
<UserControl
x:Class="Flix.SupplyChain.CinemaLibrary.Views.TransferPackagesView"
xmlns:telerikData="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data"
>
<telerik:RadGridView
Name="RadGridView1"
ItemsSource="{Binding Path=CinemaPackages, Mode=TwoWay}"
>
<telerik:RadGridView.Columns>
<telerik:GridViewComboBoxColumn
ItemsSource ="{Binding Path, Mode=TwoWay}"
ItemsSourceBinding="{Binding Paths}"
DataMemberBinding="{Binding Path }"
IsComboBoxEditable="True"
UniqueName="ExportPath"
/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</UserControl>
OUTPUT:
System.Windows.Data Error: BindingExpression path error: 'Path' property not found on 'Flix.SupplyChain.CinemaLibrary.TransferPackagesViewModel' 'Flix.SupplyChain.CinemaLibrary.TransferPackagesViewModel' (HashCode=58543024). BindingExpression: Path='Path' DataItem='Flix.SupplyChain.CinemaLibrary.TransferPackagesViewModel' (HashCode=58543024); target element is 'Telerik.Windows.Controls.GridViewComboBoxColumn' (Name='null'); target property is 'ItemsSource' (type 'System.Collections.IEnumerable')..