Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Combobox in datagrid question - displaying a property of the combo in a textbox

$
0
0

I'd like to put a property of a combobox in a textbox on a datagrid.

Combo in a datagrid defined like so:

 

Xaml:

<DataGridTemplateColumn x:Name="cboPartBCPT" Header="CPT Code" Width="100" ><DataGridTemplateColumn.CellTemplate><DataTemplate><TextBlock Text="{Binding CPT}" /></DataTemplate></DataGridTemplateColumn.CellTemplate><DataGridTemplateColumn.CellEditingTemplate ><DataTemplate><ComboBox x:Name="cboPartBCPT"
                                                ItemsSource="{Binding Source = {StaticResource PartB_CPTLookup}}"
                                                SelectedValue="{Binding Path=CPT}"
                                                SelectedValuePath="CPT"
                                                DisplayMemberPath="CPT"
                                                           IsSynchronizedWithCurrentItem="True"></ComboBox></DataTemplate></DataGridTemplateColumn.CellEditingTemplate></DataGridTemplateColumn><DataGridTextColumn x:Name="PartBProcedure" Header="Procedure" Width="200"
                                            Binding="{Binding SelectedItem.ProcedureName, ElementName=cboPartBCPT}" />

PartBProcedure is always blank. What am I doing wrong?


Thanks.


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>