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

Set All Rows Auto Height

2 Answers 71 Views
Spreadsheet
This is a migrated thread and some comments may be shown as answers.
SierraDev20
Top achievements
Rank 1
SierraDev20 asked on 08 Nov 2019, 05:06 PM
I'm attempting to load an Excel spreadsheet into the Spreadsheet control (which, I've been able to do dynamically). However, our spreadsheets have more than a single line of text and therefore need to have auto height set to the entire worksheet versus per row. How would we go about doing this? I've read the documentation about setting specific row(s) auto-height, but nothing for setting the entire worksheet to have auto-height rows.

2 Answers, 1 is accepted

Sort by
0
Peter Milchev
Telerik team
answered on 13 Nov 2019, 01:14 PM

Hello,

The Worksheets indeed does not have the auto row height functionality. The solution to that is to select a big range of rows on the client-side and set the wrap property to true, which will adjust the cell height, hence affect the whole row height.

Another option is on the server-side to iterate over the generated cells and set the .Wrap property.

There is also a feature request for the underlying Kendo UI Spreadsheet widget where you can follow the feature progress and cast your vote:

 

Regards,
Peter Milchev
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Dave
Top achievements
Rank 2
answered on 08 Dec 2020, 10:16 PM

Iterating server side is not working for me.

In the example below, each cells background color is set as expected, however the row height remains the default.

I have tried setting the row.height = row.height * 4, but row.height is nothing so it does not work.  I can count the number lines in a cell to get the count of how many times to multiply the row height, but cannot get it to work.

For Each rowc As Row In sheet.Rows
    For Each cellc As Cell In rowc.Cells
        cellc.Wrap = True
        cellc.Background = "#eeeeee"
    Next
Next
Tags
Spreadsheet
Asked by
SierraDev20
Top achievements
Rank 1
Answers by
Peter Milchev
Telerik team
Dave
Top achievements
Rank 2
Share this question
or