I have a combobox with the SelectedItem property bound to a DataRowView and the ItemSource to a DataView.
The binding is like this:
<ComboBox Grid.Row="1" Grid.Column="1" KeyboardNavigation.TabIndex="0" Width="300"
ItemsSource="{Binding Path=MainConfigItems, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
SelectedValuePath="Id"
DisplayMemberPath="Name"
SelectedItem="{Binding MainConfigSelectedItem}"
Name="cmbBoxMainConfig"
VerticalAlignment="Center" HorizontalAlignment="Left" IsEnabled="{Binding IsEnabledMainConfig}">
</ComboBox>
Now, based on a condition, I need to hide the combobox and display a textbox in its place with text as the display member of the combobox. In this case, the 'Name' attribute of the DataRowView.
What would be the best way to do this?