Search code examples
xamlwindows-store-appstextblock

Vertical Textbox not filling all space - windows 8.1


I have this datatemplate for items in a Listview, its a bunch of rows, with 4 columns, and on first column im trying to add a text displayed in vertical. So far i have this, the text appears in vertical but for some reason it shows cutted in the ends.

    <DataTemplate x:Key="ActionItemTemplate">
    <Grid Height="150" HorizontalAlignment="Left"  >
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="60"/>
            <ColumnDefinition Width="470"/>
            <ColumnDefinition Width="470"/>
            <ColumnDefinition Width="100"/>
        </Grid.ColumnDefinitions>

        <Grid Grid.Column="0" Background="Tomato">
            <TextBlock Text="In Progress" RenderTransformOrigin="0.5,0.5" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center">
                <TextBlock.RenderTransform>
                    <RotateTransform Angle="-90" />
                </TextBlock.RenderTransform>
            </TextBlock>
        </Grid>

        <Grid Grid.Column="1" Background="Blue"></Grid>
        <Grid Grid.Column="2" Background="Green"></Grid>
        <Grid Grid.Column="3" Background="Yellow"></Grid>

    </Grid>
</DataTemplate>

enter image description here

Do i need to add anything ?


Solution

  • I used blend to modify your code, here is the result enter image description here

    and here is the code :

          <Grid Grid.Column="0" Background="Tomato">
                    <TextBlock Text="In Progress In Progress In Progress "  RenderTransformOrigin="0.5,0.5" Foreground="White" HorizontalAlignment="Center" VerticalAlignment="Center" Height="19" Margin="-149.5,65.5,-155.5,65.5" UseLayoutRounding="False" d:LayoutRounding="Auto">
                            <TextBlock.RenderTransform>
                                <RotateTransform Angle="-90" />
                            </TextBlock.RenderTransform>
                        </TextBlock>
                    </Grid>
    

    you should try it