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

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

1 Answer 66 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dean
Top achievements
Rank 1
Dean asked on 01 Nov 2012, 09:39 PM
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:

1 Answer, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 06 Nov 2012, 09:46 AM
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.


Greetings,

Vera
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Dean
Top achievements
Rank 1
Answers by
Vera
Telerik team
Share this question
or