Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Vertical alignment of DatagridCell

$
0
0

Setting DataGrid RowHeight and the following DatagridCell style is making only the row bigger and not the cell from the image inserted. Please help me to correct this.

 <Style TargetType="DataGridCell">
            <Setter Property="VerticalAlignment"
                    Value="Center" />
 </Style>

 <DataGrid x:Name="TestGrid"
                  CanUserAddRows="False"
                  AutoGenerateColumns="False"
                  RowHeight="30">
            <DataGrid.Columns>
                <DataGridTextColumn Header="Name"
                                    Width="100"
                                    Binding="{Binding Name}" />
                <DataGridTextColumn Header="Age"
                                    Width="100"
                                    Binding="{Binding Age}" />
                <DataGridTextColumn Header="Location"
                                    Width="100"
                                    Binding="{Binding Location}" />
            </DataGrid.Columns>
        </DataGrid>

DataGrid Image

Regards,

Ramakrishna


Ramakrishna


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>