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

Regex masked column

3 Answers 114 Views
GridView
This is a migrated thread and some comments may be shown as answers.
cwc
Top achievements
Rank 1
cwc asked on 10 Aug 2010, 07:19 PM
I'm working with a grid and need to be able to mask one of the columns with the following format:

XXX-XXXXXX-XXXX-XXXX

An X can be either [0-9] or [A-Z]. Lowercase input could also be allowed, in which case it would be normalized to uppercase before being saved to the data store.

Is there any way to use the built-in masking for this? If not, how would I get started with rolling my own (i.e. what events do I hook when a character is entered, etc.)?

3 Answers, 1 is accepted

Sort by
0
Veselin Vasilev
Telerik team
answered on 11 Aug 2010, 08:23 AM
Hello cwc,

Please check the Regular Expression support section of this help topic.

Kind regards,
Veselin Vasilev
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
cwc
Top achievements
Rank 1
answered on 11 Aug 2010, 03:39 PM
Thanks for the reply. The example demonstrates what I need to accomplish, but only with a masked text box. As I'm working with a grid, I'm not sure how to use that information. The GridViewDataColumn doesn't seem to have a property for MaskType, or even a ValueChanging event.

Maybe there is a resource I'm missing that allows me to treat a column as a masked text box. Could you please explain a little further as to how I might use the technique shown in the example to mask a grid column?

Thanks
0
Vlad
Telerik team
answered on 11 Aug 2010, 04:14 PM
Hello ,

 You can declare desired control with desired settings using CellTemplate property of GridViewDataColumn. 

Greetings,
Vlad
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
GridView
Asked by
cwc
Top achievements
Rank 1
Answers by
Veselin Vasilev
Telerik team
cwc
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or