GridViewCell text not visible when GridViewRow Height property is set and another cell contains text with line breaks

2 posts, 0 answers
  1. Dean
    Dean avatar
    64 posts
    Member since:
    Aug 2011

    Posted 01 Nov 2012 Link to this post

    When I set the MaxHeight property of a GridViewRow to 22, for example, and one of the cells contains longer text with multiple line breaks the text in other cells is no longer visible.

    When I remove the MaxHeight property of the GridViewRow the row height is automatically adjusted to fit the height of the cell containing the longer thext with multiple breaks and the text in other cells reapperas but it is vertically centered.

    I tried applying a cell style to other cells with VerticalContentAlignment set to Top but the text in other cells still remained hidden.

    Also, even though I've set the TextWrapping to NoWrap and TextTrimming to WordEllipsis for the column containing the longer text with line breaks the text in that cell is displayed in two rows.

    Is there any way to prevent text in other cells from disappearing when the MaxHeight is set to lower than what one of the cells content height is? If not, I'd say that this is a bug...

    UPDATE: Using the cell style with VerticalContentAlignment set to Top actually works but than you have to keep adjusting the padding... is there a better solution?

    Here is the attached image of how ugly that looks:
  2. Vera
    Vera avatar
    263 posts

    Posted 06 Nov 2012 Link to this post

    Hi Dean,

    The cell's VerticalContentAlignment property is set to Center by default. In order to show the text when wrapping is applied, you need to set the property to Top by using cell style. I can only suggest you to customize the cell template so you can achieve the desired look. 
    As for the issue with TextWrapping set to NoWrap and TextTrimming set to WordEllipsis, I was not able to reproduce it using the latest official version - Q3 2012.


    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top