I am trying to select ComboBox name. But when the Combobox is in a DataTemplate, I can't reach it. Can you help me?
When the Combobox is not in a DataTemplate, I can select dot. in .cs file:
-XAML-
<StackPanel>
<ComboBox Grid.Column="0" Grid.Row="0" Name="dot" DropDownClosed="dot_DropDownClosed" />
</StackPanel>
-.CS-
private void vove_DropDownClosed(object sender, EventArgs e)
{
var tableTopLetter = dot.SelectedValue.ToString();
MessageBox.Show(tableTopLetter);
}
When the Combobox is in a DataTemplate:
<DataGridTemplateColumn x:Name="Cobo" Header="TableTop Type">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox x:Name="Cobo3" ItemsSource="{Binding strArray}" >
<ComboBoxItem Content="A" />
<ComboBoxItem Content="B" />
<ComboBoxItem Content="C" />
</ComboBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
I can't select "Cobo3" in .cs
public mFlow()
{
InitializeComponent();
Cobo3. '<--- can't find
}