Last Updated: 28 Aug 2023 11:58 by ADMIN
Created on: 28 Aug 2023 11:27
Category: PdfViewer
Type: Bug Report
RadPdfViewer: Selected option (Thumbnails/Bookmarks) is reset after resizing

Load a document with bookmarks and select the bookmarks options. Then, move the splitter:

Expected: the selected option (bookmarks) is unchanged

Actual: the selected option (bookmarks) is not preserved and it is reset

1 comment
Dess | Tech Support Engineer, Principal
Posted on: 28 Aug 2023 11:58

Hello, David,

Thank you for bringing this to our attention.

the possible solution that I can suggest is to restore the selected options once the use releases the mouse: 

    Sub New()

        ' This call is required by the designer.

        AddHandler Me.RadPdfViewer1.ContainerElement.MouseDown, AddressOf RadPdfViewer_MouseDown
        AddHandler Me.RadPdfViewer1.ContainerElement.MouseUp, AddressOf RadPdfViewer_MouseUp
    End Sub

    Private Sub RadPdfViewer_MouseUp(sender As Object, e As MouseEventArgs)
        If IsInResizeLocation(e.Location) AndAlso isBookmarksSelected Then
            isBookmarksSelected = False
        End If
    End Sub

    Dim isBookmarksSelected As Boolean = False
    Private Sub RadPdfViewer_MouseDown(sender As Object, e As MouseEventArgs)
        If IsInResizeLocation(e.Location) Then
            If Not Me.RadPdfViewer1.ContainerElement.IsBookmarksHidden Then
                isBookmarksSelected = True
            End If 
        End If 
    End Sub

    Private Function IsInResizeLocation(ByVal location As Point) As Boolean
        If Me.ElementTree Is Nothing Then
            Return False
        End If

        Dim element As RadElement = Me.RadPdfViewer1.ContainerElement.ElementTree.GetElementAtPoint(New Point(location.X, location.Y)) 
        If element Is Nothing Then
            Return False
        End If

        If TypeOf element Is PdfSizeGripElement Then
            Return True
        End If

        Return False
    End Function

Please excuse us for the inconvenience caused. We will do our best to introduce a proper fix.

Dess | Tech Support Engineer, Principal
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.