Andreas Zita
Andreas Zita

Reputation: 7580

How to keep relative width on grid-columns in WPF?

I have a grid with two columns where Width is set to 1* on both. If one of the columns has content that wont fit, its columns in made slightly larger -> no relative width of 1* anymore. Is it possible to force the width-relations and instead making the entire grid wider so that both columns still can have the same size?

Upvotes: 1

Views: 815

Answers (1)

Dmitry Ornatsky
Dmitry Ornatsky

Reputation: 2237

<Grid Grid.IsSharedSizeScope="True">
    <Grid.ColumnDefinitions>
        <ColumnDefinition SharedSizeGroup="shared"/>
        <ColumnDefinition SharedSizeGroup="shared"/>
    </Grid.ColumnDefinitions>
            ...
</Grid>

Upvotes: 1

Related Questions