Set Row Height to Single Line

2 posts, 0 answers
  1. Samuel
    Samuel avatar
    3 posts
    Member since:
    Aug 2012

    Posted 19 Jan 2017 Link to this post

    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.

  2. Dimitar
    Admin
    Dimitar avatar
    2949 posts

    Posted 19 Jan 2017 Link to this post

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