Completed
Last Updated: 16 Feb 2017 07:23 by ADMIN
ADMIN
Hristo
Created on: 19 Jan 2017 10:33
Category: PageView
Type: Feature Request
2
IMPROVE. RadPageView - setting defining the wrap mode when navigating the pages using the arrow keys
Currently the pages are wrapped around, i.e. when one reaches the last pages and select next using the down arrow key the first page gets selected

Workaround: 
Public Class MyRadPageView
    Inherits RadPageView

    Public Overrides Property ThemeClassName As String
        Get
            Return GetType(RadPageView).FullName
        End Get
        Set(value As String)
            MyBase.ThemeClassName = value
        End Set
    End Property

    Protected Overrides Function CreateUI() As RadPageViewElement
        Select Case Me.ViewMode
            Case PageViewMode.Stack
                Return New RadPageViewStackElement()
            Case PageViewMode.Outlook
                Return New RadPageViewOutlookElement()
            Case PageViewMode.ExplorerBar
                Return New RadPageViewExplorerBarElement()
            Case PageViewMode.Backstage
                Return New MyRadPageViewBackstageElement()
            Case Else
                Return New RadPageViewStripElement()
        End Select
    End Function

End Class

Public Class MyRadPageViewBackstageElement
    Inherits RadPageViewBackstageElement

    Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
        Get
            Return GetType(RadPageViewBackstageElement)
        End Get
    End Property

    Protected Overrides Function SelectNextItemCore(current As RadPageViewItem, forward As Boolean, wrap As Boolean) As Boolean
        Return MyBase.SelectNextItemCore(current, forward, False)
    End Function

    Protected Overrides Sub ProcessKeyDown(e As KeyEventArgs)
        If Me.IsNextKey(e.KeyCode) AndAlso Not Me.IsEditing Then
            Me.SelectNextItem()
        ElseIf Me.IsPreviousKey(e.KeyCode) AndAlso Not Me.IsEditing Then
            Me.SelectPreviousItem()
        ElseIf e.KeyCode = Keys.Home AndAlso Not Me.IsEditing Then
            Me.Owner.SelectedPage = Nothing
            Me.SetSelectedItem(Me.Items.First())
        ElseIf e.KeyCode = Keys.End AndAlso Not Me.IsEditing Then
            Me.Owner.SelectedPage = Nothing
            Me.SetSelectedItem(Me.Items.Last())
        ElseIf e.KeyCode = Keys.F2 Then
            BeginEdit()
        ElseIf e.KeyCode = Keys.Escape Then
            CancelEdit()
        ElseIf e.KeyCode = Keys.Enter AndAlso Me.IsEditing AndAlso Me.ActiveEditor.Validate() Then
            EndEdit()
        End If
    End Sub

End Class
1 comment
ADMIN
Ralitsa
Posted on: 16 Feb 2017 07:23
Setting the SelectionWrap property to false will prevent the wrap mode when navigating the pages using the arrow keys.