Spreadsheet FreezePanes - what's the secret ?

2 Answers 106 Views
Spreadsheet
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Ian asked on 26 Apr 2023, 04:37 PM

I can't seem to get FreezePanes to work.

I have a sheet populated with nothing but test character data:

I tried to freeze the top 3 rows, and the left-most 3 columns:

        mySpreadsheetControl.Workbook.Worksheets(0).ViewState.FreezePanes(3, 3)

Nothing seems to happen.

The RibbonBar menu option, to freeze either the top row or the left-most column does work. (why do I have to choose?)

Am I missing something?

2 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 28 Apr 2023, 01:39 PM

Hi Ian,

I have logged the behavior you are experiencing as an item in the Feedback Portal on your behalf: Spreadsheet: The UI is not notified when the properties of the WorksheetViewState are changed. If you head over to the link you can find more related details, workarounds as well as subscribe to the task to track its progress and receive notifications of any status updates.

I have also updated your Telerik Points as a sign of appreciation.

I apologize for the inconvenience. If you happen to need any further assistance, we are at your disposal.

Regards, Yoan Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Ian
Top achievements
Rank 2
Bronze
Iron
Iron
commented on 19 May 2023, 09:58 AM

Still trying to get this to work.

I have had some success with a simple method:

 activeWorksheetEditor()?.FreezePanes(New CellIndex(v, 0)) 'v is the number or rows to freeze.

This works fine, but ONLY if called from the UI, by me pressing a button.

What I need is to have this applied after the sheet has been populated.  But if I call it this way, even as the very last call after everything has been loaded and formatted, then nothing happens.

Is this the same issue as above, or something different?

 

Yoan
Telerik team
commented on 23 May 2023, 07:24 AM

Hello Ian,

Currently, the only available workarounds are the ones listed in the public item. The most simple one would be using the ActiveWorksheetEditor to set the freeze panes like so:

radSpreadsheet.ActiveWorksheetEditor.FreezePanes(new CellIndex(3, 3));

I am also attaching a full project incorporating this approach for your disposal so you can compare implementations and make changes if necessary.

If that does not help, would you be able to share with us the project you are using or modify the one I have sent so that it reproduces the issue share it instead? That way I can try to find out why this is happening by examining it and then get back to you.

Hope this helps and if you have any questions feel free to ask.

Regards,

Yoan

0
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
answered on 03 Jul 2023, 04:26 PM

I accidentally found a solution to this.

Problem is, no matter where I call the FreezePanes from the methods which setup and populate the Spreadsheet, nothing works, except calling it from a button. That is, from a new message stack.

BUT

I accidentally spoted that once everything is setup, the 'mousemove' event is fired. This is part of a solution to getting cell-level tooltips to work, but it also fires reliably every time the spreadsheet loads:

Setup the method to detect 'MouseMove': (this is Telerik code from a support query, so kudos to them)

  Private Sub SpreadsheetElement_ActiveSheetEditorChanged(ByVal sender As Object, ByVal e As EventArgs)
        If Me.editor IsNot Nothing Then
            RemoveHandler Me.editor.MouseMove, AddressOf Editor_MouseMove
        End If

        Me.editor = mySpreadsheetControl.ActiveWorksheetEditor

        If Me.editor IsNot Nothing Then
            AddHandler Me.editor.MouseMove, AddressOf Editor_MouseMove
        End If
    End Sub

Now handle the mouse move:

Private Sub Editor_MouseMove(ByVal sender As Object, ByVal e As MouseEventArgs)

(do some other stuff, but...)

 setFreeze()

end sub

and the really simple freeze call, which is what I wanted all along:

    Private colsAndRowsFrozen As Boolean = False

    ''' <summary>
    ''' Call this from a new message stack, in the hopes that it will actually do something
    ''' </summary>
    Private Sub setFreeze()
        If Not colsAndRowsFrozen Then
            mySpreadsheetControl.ActiveWorksheetEditor.FreezePanes(New CellIndex(3, 4))
            colsAndRowsFrozen = True
        End If

    End Sub

.and it works: my rows and columns get frozen as part of the setup, as far as the user is can see.

 

 

Yoan
Telerik team
commented on 06 Jul 2023, 11:19 AM

Hello Ian,

Thank you for sharing this with us and for the time and effort you have spent in the process. This information will most definitely be taken into consideration moving forward with this case. As a company, we are constantly trying to improve and keep our high standards consistent. Satisfying and keeping our customers are essential for us and that's why we value highly the effort you put in to provide us constantly with feedback and viewpoints regardless of the topic.

Your efforts are highly appreciated and do not go unnoticed.

Regards,

Yoan

Tags
Spreadsheet
Asked by
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Answers by
Yoan
Telerik team
Ian
Top achievements
Rank 2
Bronze
Iron
Iron
Share this question
or