This is a migrated thread and some comments may be shown as answers.

GridViewCheckBoxColumn with Checkbox in Header

3 Answers 333 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Martin
Top achievements
Rank 1
Martin asked on 25 Oct 2012, 04:23 PM
Hi,

I want a checkbox in my column header to select/unselect all the checkboxes in my checkbox colum.

I have the following code but it does not work:

<telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding Allowed, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                                    IsThreeState="False"
                                                    ShowDistinctFilters="False"
                                                    AutoSelectOnEdit="True"
                                                    EditTriggers="CellClick">


                        <telerik:GridViewCheckBoxColumn.Header>
                            <CheckBox Content="Allowed"
                                      IsThreeState="False"
                                      IsChecked="{Binding IsSelectedAll, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
                        </telerik:GridViewCheckBoxColumn.Header>


                    </telerik:GridViewCheckBoxColumn>

3 Answers, 1 is accepted

Sort by
0
Pavel Pavlov
Telerik team
answered on 25 Oct 2012, 04:35 PM
Hi,

Where is the "IsSelectedAll" property located ? What do you mean by "does not work " ?   -  the IsSelectedAll property does not update e.g. setter is not called   or the items do not get selected  ?

Regards,
Pavel Pavlov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Martin
Top achievements
Rank 1
answered on 26 Oct 2012, 10:35 AM
Hi Pavel,

Apologies for being vague!

I have a property in my Viewmodel called IsSelectedAll, the setter of which is not being called. I created a seperate checkbox and the functionality works. I now want that functionality in the Header.

Regards, Martin
0
Maya
Telerik team
answered on 26 Oct 2012, 11:16 AM
Hello Martin,

Could you take a look at this forum thread and the sample projects attached ? Does the approach illustrated there correspond to your needs ? 

All the best,
Maya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Martin
Top achievements
Rank 1
Answers by
Pavel Pavlov
Telerik team
Martin
Top achievements
Rank 1
Maya
Telerik team
Share this question
or