MaterialDesignInXamlToolkit icon indicating copy to clipboard operation
MaterialDesignInXamlToolkit copied to clipboard

Datagrid - column with select checkbox and select all column header

Open Keboo opened this issue 3 years ago • 1 comments

Discussed in https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/discussions/2739

Originally posted by hahyes June 9, 2022 Hi there, I followed known to me way to add to Datagrid column to select datagriditems

            <DataGrid.RowHeaderTemplate>
                <DataTemplate>
                    <Grid>
                        <CheckBox IsChecked="{Binding Path=IsSelected, Mode=TwoWay,
                     RelativeSource={RelativeSource FindAncestor,
                      AncestorType={x:Type DataGridRow}}}"/>
                    </Grid>
                </DataTemplate>
            </DataGrid.RowHeaderTemplate>

In default WPF it works as intended. In MaterialDesign it is not showing anything. Is there any way to achieve similar effect without too much code? Solution above was simple enough to implement, maybe I can do this with some fixes?

Keboo avatar Jun 10 '22 22:06 Keboo

@hahyes I can't reproduce the issue

image

Can you provide a test repo or something to be able to reproduce the problem please ?

ElieTaillard avatar Jun 10 '22 22:06 ElieTaillard

@hahyes, I'll close this issue as there has been multiple months gone by with no answer. Feel free to reopen if you can provide us with more information regarding the problem.

MichelMichels avatar Nov 08 '22 19:11 MichelMichels

Not sure if related but in my case it was simply HeadersVisibility="All" (which seems to be the default in WPF)

<Style x:Key="MaterialDesignDataGrid" TargetType="{x:Type DataGrid}"> <Setter Property="HeadersVisibility" Value="Column" />

get-flat avatar Jan 10 '24 10:01 get-flat