---
title: "Set grid to 75% of parent grid using WPF"  
description: "Set grid to 75% of parent grid using WPF"  
author: "Andrew Deniel"  
published: 2013-10-14  
updated: 2013-10-14  
canonical: https://www.mindstick.com/forum/1681/set-grid-to-75-of-parent-grid-using-wpf  
category: "wpf"  
tags: ["wpf"]  
reading_time: 2 minutes  

---

# Set grid to 75% of parent grid using WPF

```
<ScrollViewer Grid.Row="2">
    <Grid>
        <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>
        <Grid Grid.Row="0" HorizontalAlignment="Left" Margin="10,5,0,0" Width="500">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid Grid.Row="0">
                <Grid.Background >
                    <ImageBrush ImageSource="Public\Images\chat_green-textarea.png"/>
                </Grid.Background>
                <TextBlock Padding="5" Foreground="White" FontSize="15" TextWrapping="Wrap">Lorem Ipsum is simply dummy text of the printing and typesetting industry.
 </TextBlock>
            </Grid>
            <Grid Grid.Row ="1">
                <Image Source="Public\Images\chat_green-textarea-tail.png" Height="20" Width="30" HorizontalAlignment="Left" Margin="10,-4,0,0"/>
            </Grid>
        </Grid>
    </Grid>
</ScrollViewer>
```

I am displaying a [Text](https://www.mindstick.com/blog/301635/did-people-reinvent-texting-to-express-the-full-range-of-emotions) in\
a [Grid](https://www.mindstick.com/forum/369/how-can-i-add-a-column-name-to-my-grid), but I want its [max](https://www.mindstick.com/articles/1155/count-max-min-function-in-excel) width\
to be set [equals](https://www.mindstick.com/interview/33895/difference-between-and-equals-method-in-c-sharp) to the 75% of its [parent](https://www.mindstick.com/blog/154/how-to-find-parent-of-control-in-wpf) grid. Thanks!

## Replies

### Reply by Anonymous User

```
<ScrollViewer>
    <Grid>
        <Grid.ColumnDefinitions>
            <columndefinition Width="3*"/>
            <columndefintiion Width="1*"/>
        </Grid.ColumnDefinitions>
        <Grid Grid.Column="0">
           --------------
        </Grid>
    </Grid>
</ScrollViewer>
```

Put your target grid in the first column of the wrapper grid and now it will have 75% width of it's parent.


---

Original Source: https://www.mindstick.com/forum/1681/set-grid-to-75-of-parent-grid-using-wpf

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
