Completed
Last Updated: 19 Jun 2017 12:20 by ADMIN
ADMIN
Hristo
Created on: 11 Apr 2017 14:39
Category: GridView
Type: Bug Report
1
FIX. RadGridView - incorrect layout of the GroupPanelElement when maximizing and minimizing the form
Workaround: 
Friend Class MyRadGridView
    Inherits RadGridView

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

    Protected Overrides Function CreateGridViewElement() As RadGridViewElement
        Return New MyRadGridViewElement()
    End Function

End Class

Friend Class MyRadGridViewElement
    Inherits RadGridViewElement

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

    Protected Overrides Function CreateGroupPanelElement() As GroupPanelElement
        Return New MyGroupPanelElement()
    End Function

End Class

Friend Class MyGroupPanelElement
    Inherits GroupPanelElement

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

    Protected Overrides Function ArrangeOverride(finalSize As SizeF) As SizeF

        Dim clientRect As RectangleF = Me.GetClientRectangle(finalSize)

        Dim sizeGripRect As New RectangleF(clientRect.X, clientRect.Bottom - Me.SizeGrip.DesiredSize.Height, clientRect.Width, Me.SizeGrip.DesiredSize.Height)
        Me.SizeGrip.Arrange(sizeGripRect)
        clientRect.Height -= Me.SizeGrip.DesiredSize.Height

        Dim groupHeaderRect As New RectangleF(clientRect.X, clientRect.Y, Me.Header.DesiredSize.Width, clientRect.Height)
        Me.Header.Arrange(groupHeaderRect)
        clientRect.Width -= Me.Header.DesiredSize.Width

        Dim scrollViewRect As New RectangleF(clientRect.X + Me.Header.DesiredSize.Width, clientRect.Y, clientRect.Width, clientRect.Height)
        If scrollViewRect.Width > 20 Then
            Me.ScrollView.Arrange(scrollViewRect)
        End If

        Return finalSize

    End Function

End Class

0 comments