【发布时间】:2017-07-27 22:51:06
【问题描述】:
假设我有一个绑定到对象的数据网格,有什么方法可以将添加列表/变量传递给它?
具体来说:
<DataGrid x:Name="IndoorUnitTable" ItemsSource="{Binding BoundList, Mode=TwoWay, NotifyOnSourceUpdated=True, UpdateSourceTrigger=PropertyChanged}"
...
<DataTemplate x:Name="PropertyFromOtherTable">
<TextBlock Text="{Binding OtherListIWant, Mode=TwoWay, Converter={StaticResource ConverterForTwoLists}, UpdateSourceTrigger=PropertyChanged}"/>
</DataTemplate>
【问题讨论】:
-
你的问题很不清楚。是否要合并列表以使表中的行数成为每个列表中的行数之和?或者你想加入列表,使得表中的列数是两个列表中列的总和?每种方法都需要不同的方法。
-
你的问题不清楚。
标签: wpf data-binding datagrid