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

When Maximum is changed, value is changed, but display is not

1 Answer 52 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 15 Jun 2010, 06:13 PM
                <StackPanel...> 
                    <TelerikInput:RadNumericUpDown  
                        IsEnabled="{Binding ClockEnabled}" 
                        Value="{Binding UnitsValue, Mode=TwoWay}"  
                        Minimum="{Binding MinimumUnitsValue, Mode=TwoWay}"  
                        Maximum="{Binding MaximumUnitsValue, Mode=TwoWay}"  
                        SmallChange="1" ValueFormat="Numeric" IsInteger="True"/> 
                    <TelerikInput:RadComboBox  
                        x:Name="SelectedUnitComboBox" 
                        IsEnabled="{Binding ClockEnabled}" 
                        DisplayMemberPath="Label"  
                        SelectedValuePath="Value" 
                        SelectedValue="{Binding SelectedUnit, Mode=TwoWay}"/> 
                </StackPanel> 
 

        private int _MinimumUnitsValue = 0; 
        public int MinimumUnitsValue 
        { 
            get 
            { 
                return _MinimumUnitsValue; 
            } 
            set 
            { 
                if (value != _MinimumUnitsValue) 
                { 
                    _MinimumUnitsValue = value; 
                    NotifyPropertyChanged("MinimumUnitsValue"); 
                } 
            } 
        } 
 
        private int _MaximumUnitsValue; 
        public int MaximumUnitsValue 
        { 
            get 
            { 
                return _MaximumUnitsValue; 
            } 
            set 
            { 
                if (value != _MaximumUnitsValue) 
                { 
                    _MaximumUnitsValue = value; 
                    NotifyPropertyChanged("MaximumUnitsValue"); 
                } 
            } 
        } 
 
        private string _SelectedUnit = String.Empty; 
        public string SelectedUnit 
        { 
            get 
            { 
                return _SelectedUnit; 
            } 
            set 
            { 
                if (value != _SelectedUnit) 
                { 
                    _SelectedUnit = value; 
                    NotifyPropertyChanged("SelectedUnit"); 
                    switch (_SelectedUnit) 
                    { 
                        case "days"
                            MinimumUnitsValue = 1; 
                            MaximumUnitsValue = 30; 
                            break
                        case "months"
                            MinimumUnitsValue = 1; 
                            MaximumUnitsValue = 12; 
                            break
                        case "years"
                            MinimumUnitsValue = 1; 
                            MaximumUnitsValue = 70; 
                            break
                    } 
                } 
            } 
        } 


Given the above, when I change the RadComboBox from Days ([1,30]) to Months ([1,12]) the Maximum value is changed, and notification is given.  As result the value changes, and notification is given.  However, the value shown in the control itself remains the previous value - i.e., if the dropdown is set to Days, and the NumericUpDown to 30, and I change the dropdown to months, I change the MaximumUnitsValue property to 12, which causes the UnitsValue to get set to 12 (including the notification change) yet the control still shows 30.  Using the down arrow gets me 11, and up arrow gets me 12.  The value is correct, but the wrong value displayed is quite misleading.  This is Q1_2010_0603.

Tim

1 Answer, 1 is accepted

Sort by
0
George
Telerik team
answered on 18 Jun 2010, 12:40 PM
Hello Tim,

Thank you for contacting Telerik Support.

Thank you for reporting this bug. I am glad to give you 500 Telerik points for your involvement. We have added it in our To-Do list. You can track the progress of the work in our Public Issue Tracking System (PITS) with Issue ID = 2476.
 
I will be glad to assist you further.

Regards,
George
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
NumericUpDown
Asked by
Tim
Top achievements
Rank 1
Answers by
George
Telerik team
Share this question
or