SpinEditor Maximium Value Property

7 posts, 0 answers
  1. Claude
    Claude avatar
    63 posts
    Member since:
    Apr 2009

    Posted 19 Aug 2010 Link to this post

    I have a Spin Editor and want to limit the range from 0 to -16.

    If I set Minimium to - 16 and Max to 0, the upper limit goes to 100

    If I set Minimium to -16 and Max to 1, the upper limit is 1.

    Seems to be a problem. 

  2. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 23 Aug 2010 Link to this post

    I can replicate the same issue. Solvable by using the following code though. 
    Private Sub RadSpinEditor1_ValueChanged(ByVal sender As System.Object, _
        ByVal e As System.EventArgs) Handles RadSpinEditor1.ValueChanged
     
        RadSpinEditor1.Maximum = 0
    End Sub
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 23 Aug 2010 Link to this post

    Hi Claude,

    The information that you have provided leads me to the thought that you are trying to set the Minumum to a value bigger than the Maximum. However, please note that you cannot set a value for the Minimum greater than the Maximum, and Maximum lower than the Minimum. Initially, the Minimum and Maximum values are set to 0 and 100 respectively, so if you first try to set radSpinEditor.Maximum = 0, this operation will not have impact on RadSpinEditor, because 0 is equal to the Minimum.

    You should simply update the properties in the correct order:
    radSpinEditor.Minimum = -16;
    radSpinEditor.Maximum = 0;

    I hope this helps.

    Greetings, Peter
    the Telerik team

     

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Claude
    Claude avatar
    63 posts
    Member since:
    Apr 2009

    Posted 23 Aug 2010 Link to this post

    To Telerik: - I have already done that, but set it in the properties window, not within the code.  I suggest you try it in a project.

    If you set it in code, all is fine. If you set it in the properties window, it does not work.
  6. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 23 Aug 2010 Link to this post

    Hi Claude,

    Thanks for the provided details, and please, excuse us for the inconvenience.

    We will include a fix for this in our internal release this week.
     
    Don't hesitate to contact us if you have other questions.

    All the best,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  7. Richard Slade
    Richard Slade avatar
    3000 posts
    Member since:
    May 2009

    Posted 23 Aug 2010 Link to this post

    As a side note, it appears that the issue is the order in which the properties are set in the designer makes a difference. 
    When set via the properties, the designer looks like this.. 

    'RadSpinEditor1
    '
    Me.RadSpinEditor1.Location = New System.Drawing.Point(257, 312)
    Me.RadSpinEditor1.Maximum = New Decimal(New Integer() {0, 0, 0, 0})
    Me.RadSpinEditor1.Minimum = New Decimal(New Integer() {16, 0, 0, -2147483648})
    Me.RadSpinEditor1.Name = "RadSpinEditor1"

    However, if you change over the Min and Max properties to look like this

    'RadSpinEditor1
    '
    Me.RadSpinEditor1.Location = New System.Drawing.Point(257, 312)
    Me.RadSpinEditor1.Minimum = New Decimal(New Integer() {16, 0, 0, -2147483648})
    Me.RadSpinEditor1.Maximum = New Decimal(New Integer() {0, 0, 0, 0})
    Me.RadSpinEditor1.Name = "RadSpinEditor1"

    Then it behaves correctly. 
    Richard
  8. Peter
    Admin
    Peter avatar
    1148 posts

    Posted 26 Aug 2010 Link to this post

    Hi guys,

    Indeed, the way RadSpinEditor works and the order of the serialized Minumum/Maximum properties in the designer do not allow you to set certain values at design-time.

    We modified the current logic, so now the Maximum will be updated if the Minimum is greater than Maximum and the Minimum will be updated if the Maximum is lower than the Minimum. Microsoft NumericUpDown control has the same behavior.

    I hope this helps.

    All the best,
    Peter
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
UI for WinForms is Visual Studio 2017 Ready