WPF: problem with GridViewColumn.Header (reordering)

In my WPF application, I have a GridViewColumn that looks like this:

<GridViewColumn Width="170">

    <GridViewColumn.Header>
        <StackPanel Orientation="Horizontal">
            <Path Data="{StaticResource pathStar}" Fill="Gold" Stroke="Red"/>
            <TextBlock VerticalAlignment="Center">New items</TextBlock>
        </StackPanel>
    </GridViewColumn.Header>
    ...

I cannot drag / reorder a column if I click and drag any of the subobjects, such as a path or text block. Only if I click on the free space can I drag this column.

How can I drag the whole column again?

+3
source share
1 answer

Try installing IsHitTestVisible="false"on your StackPanel, Path and Textblock.

+4
source

Source: https://habr.com/ru/post/1717827/


All Articles