I have a bound ComboBox
where I need to show default item "No Selection". ComboBox
should close with no text selection and no selected item, When the user selects this option ("No Selection") from list.
These are the data resources
<UserControl.Resources>
<my:iTimeKeepBaseDataSet x:Key="iTimeKeepBaseDataSet" />
<CollectionViewSource x:Key="codeSetsViewSource" Source="{Binding Path=codeSets, Source={StaticResource iTimeKeepBaseDataSet}}" />
<CollectionViewSource x:Key="allMattersViewSource" Source="{Binding Path=allMatters, Source={StaticResource iTimeKeepBaseDataSet}}" />
<my:CodeIdToDetailsConverter x:Key="codeIdDetailsConverter" />
</UserControl.Resources>
This is ComboBox data template
<DataTemplate x:Key="CodeSetDataCellEditTemplate">
<ComboBox DataContext="{StaticResource codeSetsViewSource}"
ItemsSource="{Binding}"
SelectedValuePath="{Binding Path=codeSetId}"
SelectionChanged="OnCodeSetsSelectionChanged"
Style="{StaticResource ComboboxTemplate}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock>
<TextBlock.Text>
<MultiBinding StringFormat="{}{0} - {1}">
<Binding Path="codeSetId" />
<Binding Path="codeSetName" />
</MultiBinding>
</TextBlock.Text>
</TextBlock>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
</DataTemplate>
Template column of DataGrid
<DataGridTemplateColumn x:Name="codeSetId1Column"
Width="SizeToHeader"
CellEditingTemplate="{StaticResource CodeSetDataCellEditTemplate}"
Header="Code Set ID 1"
my:DataGridAttachedProperty.ColumnName="codeSetId1">
Please suggest me a solution for this.
Thanks in advance