I have some comboxboxes which I populate with checkboxes. After selecting the items click on search, however the first click is used to compress the combo and then I click again to activate the button.
Is there any way to avoid having to give 2 clicks to trigger a button after opening a combobox? Make the first click compress the combo and hit the button.
As it is: I click the combobox, select the items, click outside the combo box, click the button. (same click on the button, the first click is always to compress the combo).
How would it be: I click on the combobox, select the items, click the button.
<ComboBox
Grid.Column="3"
Grid.Row="1"
x:Name="cmbGrupo"
IsEditable="True"
IsReadOnly="False"
Width="120"
SelectedIndex="0"
>
<ComboBox.Resources>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="DarkGray"/>
</ComboBox.Resources>
<ComboBox.ItemTemplate>
<DataTemplate>
<CheckBox
x:Name="chkGrupo"
Content="{Binding Content}"
IsChecked="{Binding IsChecked}"
IsEnabled="{Binding IsEnabled}"
Checked="chk_Changed"
Unchecked="chk_Changed"
/>
</DataTemplate>
</ComboBox.ItemTemplate>
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel/>
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
</ComboBox>
<Button
x:Name="btnPesquisar"
Content="Pesquisar"
Grid.Column="17"
Grid.Row="1"
Width="130"
Click="btnPesquisar_Click"
/>