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

Vertical alignment "top"

3 Answers 144 Views
GridView
This is a migrated thread and some comments may be shown as answers.
madladuk
Top achievements
Rank 2
madladuk asked on 24 Nov 2010, 05:22 PM
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

3 Answers, 1 is accepted

Sort by
0
Maya
Telerik team
answered on 24 Nov 2010, 05:31 PM
Hi madladuk,

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>

All the best,
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?
0
Vanya Pavlova
Telerik team
answered on 07 Mar 2011, 08:00 AM
Hello Geoff,

 
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.   


Best wishes,
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!
Tags
GridView
Asked by
madladuk
Top achievements
Rank 2
Answers by
Maya
Telerik team
Geoff Hardy
Top achievements
Rank 1
Vanya Pavlova
Telerik team
Share this question
or