我需要找出如何将字符串传递给a的 aComboBox
内部。背后的想法是,每当我双击a出现并从中选择新内容时(在 a 内)。TemplateColumn
DataGrid
TextBox
Popup
TextBox
ComboBox
Popup
XAML
<DataGridTemplateColumn Header="unit">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBox Text="{Binding unit}" MouseDoubleClick="TextBox_MouseDoubleClick_1" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<!-- The columns in the grid are binded to DataTable-->
<!-- Popup -->
<Popup Name="unitpop" StaysOpen="True" VerticalOffset="-20" HorizontalOffset="30" Placement="Mouse" >
<Grid Width="100" Height="20" Background="Transparent" >
<ComboBox x:Name="unit_combo" ItemsSource="{Binding Source={StaticResource UnitListData}}" DisplayMemberPath="Name" SelectedValuePath="idunit" IsReadOnly="True" SelectionChanged="unit_combo_SelectionChanged" />
</Grid>
</Popup>
<!-- The ComboBox is binding an ObservableCollection -->