How to remove checkbox from gridview item on pointerover?

Alex Oh 96 Reputation points
2020-03-06T21:17:21.55+00:00
<ControlTemplate TargetType="GridViewItem">  
                    <ListViewItemPresenter   
                        x:Name="Root" CheckBrush="{ThemeResource GridViewItemCheckBrush}"   
                        ContentMargin="{TemplateBinding Padding}"   
                        CheckBoxBrush="Transparent"   
                        ContentTransitions="{TemplateBinding ContentTransitions}"   
                        CheckMode="Inline"   
                        DragOpacity="{ThemeResource ListViewItemDragThemeOpacity}"   
                        DisabledOpacity="{ThemeResource ListViewItemDisabledThemeOpacity}"   
                        DragBackground="{ThemeResource GridViewItemDragBackground}"   
                        DragForeground="{ThemeResource GridViewItemDragForeground}"   
                        FocusBorderBrush="{ThemeResource GridViewItemFocusBorderBrush}"   
                        FocusVisualMargin="{TemplateBinding FocusVisualMargin}"   
                        FocusSecondaryBorderBrush="{ThemeResource GridViewItemFocusSecondaryBorderBrush}"   
                        HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"   
                        Control.IsTemplateFocusTarget="True"   
                        PressedBackground="{ThemeResource GridViewItemBackgroundPressed}"   
                        PlaceholderBackground="{ThemeResource GridViewItemPlaceholderBackground}"   
                        PointerOverForeground="{ThemeResource GridViewItemForegroundPointerOver}"   
                        PointerOverBackground="{ThemeResource GridViewItemBackgroundPointerOver}"   
                        RevealBorderThickness="{ThemeResource GridViewItemRevealBorderThemeThickness}"   
                        ReorderHintOffset="{ThemeResource GridViewItemReorderHintThemeOffset}"   
                        RevealBorderBrush="{ThemeResource GridViewItemRevealBorderBrush}"   
                        RevealBackground="{ThemeResource GridViewItemRevealBackground}"   
                        SelectedForeground="{ThemeResource GridViewItemForegroundSelected}"   
                        SelectionCheckMarkVisualEnabled="False"   
                        SelectedBackground="{ThemeResource GridViewItemBackgroundSelected}"   
                        SelectedPressedBackground="{ThemeResource GridViewItemBackgroundSelectedPressed}"   
                        SelectedPointerOverBackground="{ThemeResource GridViewItemBackgroundSelectedPointerOver}"   
                        VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}">  
...  
/>  

I can set CheckBoxBrush to transparent, but that is only for default state. When I hover over gridview item, the checkbox reappears. How can I make sure it does not appear on pointerover and selection?

Universal Windows Platform (UWP)
0 comments No comments
{count} votes

Accepted answer
  1. Alex Oh 96 Reputation points
    2020-03-06T21:48:05.623+00:00

    Answer my own question here. No need to edit the control template. Just need to set:

    SelectionMode="Multiple" IsMultiSelectCheckBoxEnabled="False" >  
    

0 additional answers

Sort by: Most helpful