Vertical alignment "top"

4 posts, 0 answers
  1. madladuk
    madladuk avatar
    126 posts
    Member since:
    Dec 2009

    Posted 24 Nov 2010 Link to this post


    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.

  2. Maya
    Maya avatar
    4062 posts

    Posted 24 Nov 2010 Link to this post

    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:

        <Style TargetType="telerik:GridViewCell">
            <Setter Property="VerticalContentAlignment" Value="Top" />

    All the best,
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. Geoff Hardy
    Geoff Hardy avatar
    58 posts
    Member since:
    Feb 2010

    Posted 02 Mar 2011 Link to this post

    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?
  4. Vanya Pavlova
    Vanya Pavlova avatar
    2019 posts

    Posted 07 Mar 2011 Link to this post

    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!
Back to Top