原文:WPF DataGrid 每行ComboBox 内容不同的设置方法
<toolkit:DataGridComboBoxColumn x:Name="DgCbcSignal" Header="信号源" SelectedItemBinding="{Binding SelectedSignal}" > <toolkit:DataGridComboBoxColumn.ElementStyle> <Style TargetType="ComboBox"> <Setter Property="ItemsSource" Value="{Binding Path=Signals}" /> </Style> </toolkit:DataGridComboBoxColumn.ElementStyle> <toolkit:DataGridComboBoxColumn.EditingElementStyle> <Style TargetType="ComboBox"> <Setter Property="ItemsSource" Value="{Binding Path=Signals}" /> </Style> </toolkit:DataGridComboBoxColumn.EditingElementStyle> </toolkit:DataGridComboBoxColumn>
按照上述方法能做到每行单独绑定。
原文地址:https://www.cnblogs.com/lonelyxmas/p/9559554.html
时间: 2024-10-09 22:19:24