GridViewCheckBox - cannot check / uncheck

0 Answers 29 Views
GridView
Lukasz
Top achievements
Rank 1
Lukasz asked on 22 Aug 2022, 09:04 AM | edited on 22 Aug 2022, 09:05 AM

Hi,

I have created a RadGridView with a couple of columns (one of them being GridViewSelectColumn). I have also created a GroupDescriptor with GroupHeaderTemplate and I would like to add a GridViewCheckBox to the GroupHeaderTemplate, so I can select all items in a particular group by one click, however, the GridViewCheckBox is not enabled. I tried different properties on the control, but none of them works for me. 

If I add just a CheckBox then it works, but it does not have the style I need and I would not like to reproduce the Style already present on GridViewSelectColumn.

Can you advise how to enable the GridViewCheckBox ?

Thanks

            <telerik:RadGridView Grid.Row="1" ItemsSource="{Binding Collection}"
                                 AutoGenerateColumns="False"
                                 ShowGroupPanel="False"
                                 RowIndicatorVisibility="Collapsed"
                                 Padding="10"
                                 IsReadOnly="True"
                                 FrozenColumnsSplitterVisibility="Collapsed"
                                 IsFilteringAllowed="False"
                                 SelectionUnit="FullRow"
                                 SelectionMode="Extended">
                <telerik:RadGridView.GroupHeaderTemplate>

    <DataTemplate x:Key="SelectAllGroupHeaderTemplate">
        <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
            <telerik:GridViewCheckBox VerticalAlignment="Center" HorizontalAlignment="Center">

            </telerik:GridViewCheckBox>
            <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="DemiBold"
                       Margin="10 0 0 0"
                       Text="{Binding RelativeSource={RelativeSource Mode=FindAncestor,
                                       AncestorType={x:Type telerik:GridViewGroupRow}},
                                       Path=Group.Key}" />
        </StackPanel>
    </DataTemplate>


                </telerik:RadGridView.GroupHeaderTemplate>
                <telerik:RadGridView.GroupDescriptors>
                    <telerik:GroupDescriptor Member="Id"
                                             SortDirection="Ascending" />
                </telerik:RadGridView.GroupDescriptors>
                <telerik:RadGridView.Columns>
                    <telerik:GridViewSelectColumn/>
                    <telerik:GridViewDataColumn Header="Date" MinWidth="150"
                                                DataMemberBinding="{Binding RollDate}" />
                    <telerik:GridViewDataColumn Header="ID" MinWidth="100"
                                                DataMemberBinding="{Binding Id}" />
                    <telerik:GridViewDataColumn Header="Name" MinWidth="220"
                                                DataMemberBinding="{Binding Name}" />
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
        </Grid>

 

Lukasz
Top achievements
Rank 1
commented on 22 Aug 2022, 11:00 AM

It is a duplicate, you can close this one or even remove
Dilyan Traykov
Telerik team
commented on 24 Aug 2022, 10:19 AM

Hi Lukasz,

I just responded to the other thread that you opened. To avoid duplicate content, let us please continue any further communication on the matter there.

Thank you in advance for your cooperation and understanding.

No answers yet. Maybe you can help?

Tags
GridView
Asked by
Lukasz
Top achievements
Rank 1
Share this question
or