question

aloha1 avatar image
0 Votes"
aloha1 asked ·

How to remove checkbox from gridview item on pointerover?

 <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?

uwpuwp-xaml
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

aloha1 avatar image
0 Votes"
aloha1 answered ·

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

 SelectionMode="Multiple" IsMultiSelectCheckBoxEnabled="False" >



· 1 · Share
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Glad you found the solution. You can mark your answer so that it can help more people

0 Votes 0 · ·