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

How to restrict user to entering hexadecimal value

2 Answers 227 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Peter
Top achievements
Rank 1
Veteran
Peter asked on 01 Jul 2020, 08:47 AM

I'd like to be able to use a masked input control to allow the user to enter a hexadecimal number representing a color value (ARGB) e.g. #FF445566 or 0x445566. Is there some way I can use one of the mask controls to achieve this?

Thanks
Pete

2 Answers, 1 is accepted

Sort by
0
Peter
Top achievements
Rank 1
Veteran
answered on 01 Jul 2020, 08:51 AM
More specifically I want to link this to a RadColorPicker control, so that they can either select a color from the picker or type in the exact value they want.
0
Vladimir Stoyanov
Telerik team
answered on 06 Jul 2020, 07:16 AM

Hello Pete,

Can you check out the RadColorEditor control? It allows for selecting a color from a palette or typing a hex value or RGB values directly. 

As for the masked input controls, there isn't an out of the box way to achieve the desired behavior. You would have to convert the entered text and create a Color object, which you can pass to the SelectedColor property of the RadColorPicker. 

I hope you find this information helpful. Let me know, if I can be of any further assistance.

Regards,
Vladimir Stoyanov
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Peter
Top achievements
Rank 1
Veteran
Answers by
Peter
Top achievements
Rank 1
Veteran
Vladimir Stoyanov
Telerik team
Share this question
or