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

Full customization of display

3 Answers 13 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Patrick
Top achievements
Rank 2
Veteran
Iron
Patrick asked on 24 Jan 2014, 10:41 AM
Hello,
it would be great if we can have more control about the formatting of the value in the up/down.
I have a scenario where I must use the control to edit a duration in minutes. When the duration is 1 hour or more, it should be displayed as 1:05, for example.
This scenario would be feasible if you had a FormatValue and a ParseValue virtual methods, so we can inherit from the base class and customize completely the display.
Patrick

3 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 29 Jan 2014, 12:27 PM
Hello Patrick,

As far as I understand the requirement you need to display time duration in the NumericUpDown and the SmallChange step to be 5 minutes? What I can suggest you in this case is to use the ValueChanged event where you can get the new value and modify it as required. For your convenience I prepared and attached here a sample project which demonstrates the exact approach.

I would also like to thank you for your feedback, you could log that as a feature request in our Feedback portal. It will be reviewed and it might be considered for implementation later in time depending on the customers demand.

Hope this helps.

Regards,
Kalin
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
Patrick
Top achievements
Rank 2
Veteran
Iron
answered on 29 Jan 2014, 12:44 PM
Hello Kalin,
that's an interesting solution, but the durations are mainly in minutes and rarely in hours, so it would be nice that, if the user enters 12, the value was 12 minutes and not 12 hours.
The main use is for the duration of the sets in a volleyball or beach volleyball match.
Patrick
0
Rosen Vladimirov
Telerik team
answered on 03 Feb 2014, 08:39 AM
Hi Patrick,

You can execute your logic on ValueChanged event and change the value based on your needs. In the example we've sent you, the value is just shown with custom delimiter and if the "minutes" are more than 59, the value is parse as TimeSpan. This solution obviously has some issues, but you can modify it further. You can also use KeyDown event of RadNumericUpDown and combine it with ValueChanged in order to get the exact logic you need.

Of course you can add this feature request in our feedback portal and if there is enough customer demand, we'll consider adding it to our control.

Hopefully this helps. Feel free to contact us in case you have any problems or concerns.

Regards,
Rosen Vladimirov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
NumericUpDown
Asked by
Patrick
Top achievements
Rank 2
Veteran
Iron
Answers by
Kalin
Telerik team
Patrick
Top achievements
Rank 2
Veteran
Iron
Rosen Vladimirov
Telerik team
Share this question
or