This is a migrated thread and some comments may be shown as answers.

SpinEditor Maximium Value Property

6 Answers 427 Views
SpinEditor
This is a migrated thread and some comments may be shown as answers.
Claude
Top achievements
Rank 1
Claude asked on 19 Aug 2010, 06:33 PM
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. 

6 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 23 Aug 2010, 11:20 AM
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
0
Peter
Telerik team
answered on 23 Aug 2010, 12:05 PM
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
0
Claude
Top achievements
Rank 1
answered on 23 Aug 2010, 12:55 PM
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.
0
Peter
Telerik team
answered on 23 Aug 2010, 01:55 PM
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
0
Richard Slade
Top achievements
Rank 2
answered on 23 Aug 2010, 02:35 PM
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
0
Peter
Telerik team
answered on 26 Aug 2010, 08:55 AM
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
Tags
SpinEditor
Asked by
Claude
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
Peter
Telerik team
Claude
Top achievements
Rank 1
Share this question
or