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

Set Row Height to Single Line

1 Answer 324 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Samuel
Top achievements
Rank 1
Samuel asked on 19 Jan 2017, 11:08 AM

Hi.

I've got a text column that has multiple lines in some of the cells.  When I auto-size the rows those rows show up very tall to display all the text, but I prefer to show just the top line and keep the row height the same as the rest.  My first problem is that I can't find out what that height should be.  Every time I look at Rows[n].Height I see -1.

It's not a perfect solution anyway, but I'm still curious about that value.  For a better solution, I'd like some way of finding out the proper height of a single row given the font I'm using.

Thanks in advance for any help.

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 19 Jan 2017, 12:10 PM
Hello Samuel,

By default, all rows have the same height when the AutoSizeRows functionality is switched off. It is determined by the following property:
radGridView1.TableElement.RowHeight = 30;

The above height is taken if the row height is not explicitly set, and you can set the height of a specific row like this:
radGridView1.Rows[1].Height = 50;

I hope this will be useful. Let me know if you have additional questions.

Regards,
Dimitar
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
GridView
Asked by
Samuel
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or