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

Freeze Rows

1 Answer 295 Views
SpreadStreamProcessing
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Peter asked on 03 May 2019, 01:34 PM

I was curious to know the process for simply freezing a specified set of rows at the top.

For example, we have a title section which takes up 7 rows, with each set of cells in a row merged to the number of columns.  The variable colSpan would be the number of header columns in the spreadsheet. 

worksheet.MergeCells(0, 0, 0, colSpan - 1); // first title segment
worksheet.MergeCells(1, 0, 1, colSpan - 1); // second title segment
...

 

I simply want to be able to freeze those top rows and be able to scroll both vertically and horizontally through the data below the frozen rows.

using (IWorksheetViewExporter worksheetView = worksheet.CreateWorksheetViewExporter())
 {                           
       worksheetView.SetFreezePanes(8, colSpan);
 }

 

However, when I use the freeze panes method, you can scroll vertically through all the content, but the horizontal scrolling starts in the cell at the bottom right of the last title row.  How can I achieve horizontal scrolling beginning at the first row and first cell of the rows below the title rows?

Thank you.

 

 


1 Answer, 1 is accepted

Sort by
0
Nikolay Demirev
Telerik team
answered on 07 May 2019, 12:45 PM
Hello Peter,

If I understand you correctly, you want to freeze only the first 8 rows and no columns. This can be achieved by calling the SetFreezePanes method with 8 for the rows count and 0 for the columns count like this:
using (IWorksheetViewExporter worksheetView = worksheet.CreateWorksheetViewExporter())
{                          
       worksheetView.SetFreezePanes(8, 0);
}

I hope I was able to help.

Regards,
Nikolay Demirev
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.
Tags
SpreadStreamProcessing
Asked by
Peter
Top achievements
Rank 1
Answers by
Nikolay Demirev
Telerik team
Share this question
or