任何想法,为什么当我尝试在DataGrid中编辑“文本”列时出现以下错误。
TwoWay或OneWayToSource绑定不适用于只读 属性“ Item2 datagrid ...
XAML
<DataGrid ItemsSource="{Binding Path=CustomInformation}" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Value"
IsReadOnly="False"
Binding="{Binding Item2}">
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
代码隐藏
public ObservableCollection<Tuple<string, string>> CustomInformation { get; set; } =
new ObservableCollection<Tuple<string, string>>();