How to restrict user to entering hexadecimal value

3 posts, 0 answers
  1. Peter
    Peter avatar
    64 posts
    Member since:
    Oct 2016

    Posted 01 Jul Link to this post

    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. Peter
    Peter avatar
    64 posts
    Member since:
    Oct 2016

    Posted 01 Jul in reply to Peter Link to this post

    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.
  3. Vladimir Stoyanov
    Admin
    Vladimir Stoyanov avatar
    657 posts

    Posted 06 Jul Link to this post

    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.
Back to Top