小编Des*_*erp的帖子

选择Datagrid WPF时,获取错误23和错误7

在WPf,C#中工作并使用MVVM-C我在VS的立即窗口中出现以下错误.

我正在谈论的窗口充满了一些文本框和数据网格,用户可以在其中添加新行.填写文本框时,不会显示任何问题.由于这个问题,我无法保存更改.实际上,"保存"按钮不起作用.

但是,只要我点击空数据网格以便能够添加一些数据,我就会在即时窗口中收到以下错误:

System.Windows.Data Error: 23 : Cannot convert '{NewItemPlaceholder}' from type 'NamedObject' to type 'LIMS.ViewModels.ComponentViewModel' for 'en-US' culture with default conversions; consider using Converter property of Binding. NotSupportedException:'System.NotSupportedException: TypeConverter kan niet van MS.Internal.NamedObject worden geconverteerd.
- bij System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
- bij System.ComponentModel.TypeConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
- bij MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)'

System.Windows.Data Error: 7 : ConvertBack cannot convert value '{NewItemPlaceholder}' (type 'NamedObject'). BindingExpression:Path=SelectedTestConfiguration.SelectedComponent; DataItem='TestConfigurationsPageViewModel' (HashCode=64210551); target element is 'DataGrid' (Name=''); target …
Run Code Online (Sandbox Code Playgroud)

.net c# wpf datagrid mvvm

7
推荐指数
1
解决办法
1216
查看次数

标签 统计

.net ×1

c# ×1

datagrid ×1

mvvm ×1

wpf ×1