Lost range location after the form size changed

2 posts, 1 answers
  1. Kun
    Kun avatar
    44 posts
    Member since:
    Aug 2018

    Posted 06 Mar 2019 Link to this post

    Hello,

    I use range seletor to associate with a radchartview.

    If I associate the RadChartView control to RadRangeSelector both in design time and in program (in the function "form_load"), there is a strange behavior.

    After I changed the form size, the range selector will initialize start range and end range by which means it cannot memorize the start/end range set by the movement.

    However, if I only do "Me.radRangeSelector1.AssociatedControl" ONCE in the design time or in the program, the problem will be disappeared.

    In my opinion, there is a bug in RadRangeSelector. It cannot support AssociatedControl 2 times. This issue doesn't appear for the other proprieties, even I set the other proprieties both in design time and in program.

    I made a simple demo, please download here:

    https://www.dropbox.com/s/u61lk7yql1ua25f/TestRangeSelector.rar?dl=0

     

    In order to reproduce the issue:

    step 1. launch the demo

    step 2. move range selector

    step 3. change the form size

    You will see the range selector return to its original location.

    You can remove this line in RadForm1_Load:

    RadRangeSelector1.AssociatedControl = RadChartView1

     

    Or remove the associated control in design time. You will find range selector can memorize the location all the time.

     

    It makes us lot of time to find out. If it is a bug, please correct it. If it is not, any explication ?

     

    Thank you by advance.

    Regards,

     

  2. Answer
    Hristo
    Admin
    Hristo avatar
    1520 posts

    Posted 07 Mar 2019 Link to this post

    Hello Kun,

    Indeed there is an issue and I have logged it here: RadRangeSelector: Setting the same RadChartView object as an AssociatedControl causes the range selector to go in an invalid state. Additionally, I have updated your Telerik Points.

    As a possible solution, you can use the custom range selector control below: 
    Public Class MyRadRangeSelector
        Inherits RadRangeSelector
     
        Public Overrides Property ThemeClassName As String
            Get
                Return GetType(RadRangeSelector).FullName
            End Get
            Set(value As String)
                MyBase.ThemeClassName = value
            End Set
        End Property
     
        Public Shadows Property AssociatedControl As RadControl
            Get
                Return MyBase.AssociatedControl
            End Get
            Set(ByVal value As RadControl)
     
                If MyBase.AssociatedControl Is value Then
                    Return
                End If
     
                MyBase.AssociatedControl = value
            End Set
        End Property
    End Class

    I hope this will help. Let me know if you have other questions.

    Regards,
    Hristo
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Back to Top