Hello,
I would like a RadDropDownButton with a list of checkboxes inside. So I have tried to ways of doing it: with a ListBox and with a RadGridView as a container for that list of checkboxes.
Both ways work well, but problem is that I would like that if I check the first item (called "ALL"), all the checkboxes were checked.
<telerik:RadDropDownButton x:Name="cbSalesRep" Grid.Row="0" Grid.Column="0" DropDownButtonPosition="Right" DropDownMaxHeight="300" DropDownWidth="150" DropDownMaxWidth="150" ToolTipService.ToolTip="Choose Sales Rep..." |
Height="25" Width="150" HorizontalAlignment="Left" Margin="26,15,22,0" TabIndex="11" telerik:StyleManager.Theme="Windows7" VerticalAlignment="Center"> |
<telerik:RadDropDownButton.DropDownContent> |
<telerikGridView:RadGridView x:Name="y" ItemsSource="{Binding SalesRepList, Mode=TwoWay}" ActionOnLostFocus="None" IsReadOnly="True" EditTriggers="None" GridLinesVisibility="None" ShowColumnHeaders="False" |
ShowGroupPanel="False" RowIndicatorVisibility="Collapsed" CanUserDeleteRows="False" CanUserInsertRows="False" |
CanUserSelect="False" AutoGenerateColumns="False"> |
<telerikGridView:RadGridView.Columns> |
<telerikGridView:GridViewDataColumn Header="Activity" Width="*" Background="Transparent"> |
<telerikGridView:GridViewDataColumn.CellTemplate> |
<DataTemplate> |
<CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Content="{Binding Name}"/> |
</DataTemplate> |
</telerikGridView:GridViewDataColumn.CellTemplate> |
</telerikGridView:GridViewDataColumn> |
</telerikGridView:RadGridView.Columns> |
</telerik:RadDropDownButton> |
So the gridview itemsource is SalesRepList (ViewModel), which is a Collection of items of the class SalesRep (Model), that has the property IsChecked as one of its parameters.
So I don't have SalesRep in the ViewModel, therefore I cannot use RaisePropertyChanged, and my checkboxes don't update it's value in the view!
All the examples I have seen so far were made binding the IsChecked to a property in the VM, but I cannot do that! (I have tried to bind the IsChecked to a property in the VM but it doesn't bind. Maybe because of the bind of the RadDropDownButton where the GridView is?
Any ideas?