1
如果我在DataGrid中有一个控件(ComboBox,在代码隐藏中有一个SelectionChanged事件)。 因此,从_SelectionChanged事件,我可以得到它的网格的容器单元的引用? Plz Help !!如何获取单元格引用
<DataGridTemplateColumn Width="100">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=QuotationItemCode}"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
<DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<ComboBox Height="22" Width="100" Name="cmbQuotationItemCode"
ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.vwProducts}"
DisplayMemberPath="itM_Code"
SelectedValuePath ="itM_Id"
Tag="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Row[2]}"
SelectedValue="{Binding Path=QuotationItemId}"
Text="{Binding Path=QuotationItemCode}" SelectionChanged="cmbQuotationItemCode_SelectionChanged">
</ComboBox>
<TextBlock Name="txtQuotationItemDescription" Text="{Binding Path=DetailDescription, IsAsync=True}" Height="19"></TextBlock>
</StackPanel>
</DataTemplate>
</DataGridTemplateColumn.CellEditingTemplate>
</DataGridTemplateColumn>