RadDropDownButton filled with a list of checkboxes

2 posts, 0 answers
  1. Rafael Moreno del Pino
    Rafael Moreno del Pino avatar
    4 posts
    Member since:
    Feb 2010

    Posted 23 Apr 2010 Link to this post


         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"
                                    <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:GridViewDataColumn Header="Activity" Width="*" Background="Transparent"
                                                        <CheckBox IsChecked="{Binding IsSelected, Mode=TwoWay}" Content="{Binding Name}"/> 

    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?

  2. Kiril Stanoev
    Kiril Stanoev avatar
    1508 posts

    Posted 28 Apr 2010 Link to this post

    Hello Rafael,

    I've attached a sample project that offers one possible solution to this scenario. Have a look at it and let me know how it works for you. I'd be glad to further assist you.

    Kind regards,
    Kiril Stanoev
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
Back to Top