I was able to put checkbox for all combobox items. Now I need to have a SelectAll checkbox as the first option inside the combobox. I was successful in that as well. But I would like to know the currently selected checkbox item from the Method bounded to the Command of the checkbox otherwise the SelectAll option will not work as expected.
<
DataTemplate x:Key="RowItemDataTemplate">
<CheckBox x:Name="rowCheckbox" Margin="2,2"
Command="{Binding Path=DataContext.RowCheckCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ItemsControl}}}"
Content="{Binding Path=RowName}"
IsChecked="{Binding Path=IsSelected, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
</DataTemplate>
<
ComboBox Grid.Row="0" Grid.Column="2" x:Name="cboRows" Style="{DynamicResource ValidatingComboBox}"
ItemsSource="{Binding RowItems}"
ItemTemplate="{StaticResource RowItemDataTemplate}"
Text="{Binding SelectedRowsText}"
IsEditable="True" Margin="5,0,0,0"
IsReadOnly="True"
MaxDropDownHeight="140"/>
public
ICommand RowCheckCommand
{
get
{
if (_rowCheckCommand == null)
{
_rowCheckCommand =
new RelayCommand(
param => RowCheckBoxChanged(),
param =>
true
);
}
return _rowCheckCommand;
}
}
public
void RowCheckBoxChanged()
{
NotifySelectedRowsText();
}
Is there a way, that i can pass the currently selected checkbox item to RowCheckBoxChanged() method?
I had been doing this in wpf combobox. Since i can't find any solution to my problem, i was thinking to shift to Telerik combobox, if it can solve my problem.
Any idea/suggestion will be greatly appreciated.
Regards
SVP