1
我想基於對的SelectedValue是否要啓用/禁用DataGridTextColumn鄰國DataGridComboBoxColumn ==「其他」綁定WPF DataGrid列到另一個
我可以使這項工作在下面的列表框,但這將無法在我的DataGrid環境中工作,因爲DataGridComboBox列沒有name屬性。
<ListBox Grid.Row="1" Grid.Column="1" ItemsSource="{Binding Source={StaticResource CustomData}}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<ComboBox Name="operatorComboBox" SelectedValue="{Binding OperatorId}" ItemsSource="{Binding Source={StaticResource Operator}}" SelectedValuePath="Id" DisplayMemberPath="Name"></ComboBox>
<TextBox Text="{Binding Name}" Visibility="{Binding Path=SelectedValue, ElementName=operatorComboBox, Converter={StaticResource intToVis}}"></TextBox>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
那麼這可以用DataGrid完成嗎?
(我知道我在列表框例如改變的知名度,但它不是一個質的飛躍更改爲啓用。(顯然隱藏整列將是一件壞事,在適當的DataGrid中)
this問題與我所要求的非常相似,我只是無法將解決方案縫合到我之後