Hi.
Within my gridview I have set the VerticalContentAlignment to be "Top", however the text within the columns is not aligned to the top of the cell. Please see attached screen shot.
P
Within my gridview I have set the VerticalContentAlignment to be "Top", however the text within the columns is not aligned to the top of the cell. Please see attached screen shot.
P
3 Answers, 1 is accepted
0
Hi madladuk,
All the best,
Maya
the Telerik team
If you want to align vertically the content on the cell, you may try to define a style targeting the GridViewCell and set its VerticalContentAlignment property:
<
UserControl.Resources
>
<
Style
TargetType
=
"telerik:GridViewCell"
>
<
Setter
Property
=
"VerticalContentAlignment"
Value
=
"Top"
/>
</
Style
>
</
UserControl.Resources
>
Maya
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Geoff Hardy
Top achievements
Rank 1
answered on 02 Mar 2011, 11:56 PM
This seems to work OK for when the cell is not in edit mode, however, when the cell is edited, the TextBox used for editing appears in the centre of the row, rather than at the top. See the attachment to see what I am referring to.
Is there a simple way to centre the cell for display and editing modes?
Is there a simple way to centre the cell for display and editing modes?
0
Hello Geoff,
Vanya Pavlova
the Telerik team
If you need to align the content of a GridViewCell in edit-mode, you have to edit its template and set the VerticalAlignment property of the PART_ContentPresenter to Top in this particular state (please refer to the attached picture).
Also you may find attached sample project that demonstrates this approach.
Vanya Pavlova
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!