Can't freeze pane on hidden spreadsheet

2 posts, 1 answers
  1. Steve
    Steve avatar
    87 posts
    Member since:
    May 2014

    Posted 26 Apr Link to this post

    I have a sreadsheet I created to do an export to Excel, but it isn't visible, so the ActiveWorksheetEditor never gets created so I can't freeze panes. Is there any way around this?
  2. Answer
    Boby
    Admin
    Boby avatar
    706 posts

    Posted 30 Apr Link to this post

    Hi Steve,

    Indeed ActiveWorksheet will be initialized when there are UI editor editing a specific worksheet. Instead, you can directly use the API of the WorksheetViewState for the worksheet that you get by index or by other means, for example:
    Workbook workbook = new Workbook();
    var worksheet = workbook.Worksheets.Add();
    worksheet.ViewState.FreezePanes(1, 0);
     
    // or
     
    workbook.Worksheets[0].ViewState.FreezePanes(1, 0);

    Let us know if you need additional information.

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