This is a migrated thread and some comments may be shown as answers.

Vertical alignment

2 Answers 157 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Winnie
Top achievements
Rank 1
Winnie asked on 22 Apr 2010, 09:28 PM
Hi there,
I searched already the answers here, and I have to say none are that straightforward, and I was wondering what's the easiest way to set the vertical alignment of the cell contents (to "Top" for example) to an entire row/grid?
Thanks in advance
Iulian

2 Answers, 1 is accepted

Sort by
0
Accepted
Milan
Telerik team
answered on 23 Apr 2010, 08:46 AM
Hello Winnie,

 

Currently the way to achieve that is to create a custom cell style and apply it to all columns:

01.<Grid>
02.    <Grid.Resources>
03.        <Style TargetType="grid:GridViewCell" x:Key="CustomCellStyle">
04.            <Setter Property="VerticalContentAlignment" Value="Top"/>
05.        </Style>
06.    </Grid.Resources>
07.    <telerik:RadGridView Name="playersGrid" Grid.Row="1" AutoGenerateColumns="False">
08.        <telerik:RadGridView.Columns>
09.            <telerik:GridViewDataColumn Header="Name" 
10.                                CellStyle="{StaticResource CustomCellStyle}" 
11.                                DataMemberBinding="{Binding Name}">
12.            </telerik:GridViewDataColumn>
13.            <telerik:GridViewDataColumn Header="Number" 
14.                                CellStyle="{StaticResource CustomCellStyle}" 
15.                                DataMemberBinding="{Binding Number}">
16.            </telerik:GridViewDataColumn>
17.        </telerik:RadGridView.Columns>
18.    </telerik:RadGridView>
19.</Grid>


Regards,
Milan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Winnie
Top achievements
Rank 1
answered on 23 Apr 2010, 08:23 PM
Thanks for the answer.
I will give it a try and get back with an answer; right now I am dealing with an annoying error which is probably related to my environment.
Iulian
Tags
GridView
Asked by
Winnie
Top achievements
Rank 1
Answers by
Milan
Telerik team
Winnie
Top achievements
Rank 1
Share this question
or