Freeze Panes of second worksheet

3 posts, 1 answers
  1. Bruno
    Bruno avatar
    2 posts
    Member since:
    May 2016

    Posted 01 Jun Link to this post


    I am using an radSpreadsheet with multiple worksheets. I have no problem when it comes to freezing rows and columns using FreezePanes on the first worksheet. However, I am unable to freeze cells for the second worksheet.

    Is it possible to freeze cells simultaniously on multiple worksheets of a given radSpreadsheet and, if so, could you give me an example of how this could be achieved?

    Thank you.


  2. Answer
    Nikolay Demirev
    Nikolay Demirev avatar
    102 posts

    Posted 02 Jun Link to this post

    Hello Bruno,

    One way to achieve this is to freeze the active worksheet, the way you are doing it right now, using the RadWorksheetEditor.FreezePanes() method, then to iterate through all worksheets in the workbook and modify their ViewState using the following code:
    foreach (Worksheet worksheet in workbook.Worksheets.Where(p => p != workbook.ActiveWorksheet))
        worksheet.ViewState.FreezePanes(5, 5);

    Currently, there is an issue related to notifying the UI of changes in the ViewState of the worksheet, that is why the active worksheet has to be frozen using a different approach.

    Another workaround is to get the Workbook of the RadSpreadsheet, and replace it with new Workbook, then freeze all worksheets of the original workbook, and return it to the RadSpreadsheet.

    Another workaround is to freeze all worksheets, and just change the active worksheet to another one, and then to the one, which was active before.

    I have logged a public item in our Feedback portal, you can upvote and follow it, this way you would be able to track the process on the matter.

    Nikolay Demirev
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. DevCraft R3 2016 release webinar banner
  4. Bruno
    Bruno avatar
    2 posts
    Member since:
    May 2016

    Posted 02 Jun in reply to Nikolay Demirev Link to this post

    Hello Nikolay,

    I tried using the bit of code you linked and it works.

    Thank you very much for your help.

Back to Top