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

Which event is best to format input string?

2 Answers 77 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Wellpartner
Top achievements
Rank 1
Wellpartner asked on 28 Mar 2011, 09:43 PM
I'm storing National Drug Code (NDC) in this format: #####-####-## (eg. 12345-6789-01), but would like to allow users to enter without the hyphens.  I've tried a GridViewMaskedTextBoxColumn, and while that enforces the pattern, the hyphens are omitted.  So I'm wondering which event would be best to intercept the data and insert the hyphens myself?

2 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 29 Mar 2011, 07:28 AM
Hi,

 Why not implement this directly at your property getter/setter level? You can use also Data Annotations.

Greetings,
Vlad
the Telerik team
0
Wellpartner
Top achievements
Rank 1
answered on 29 Mar 2011, 06:48 PM
Thanks, Vlad - you're right, I can just do it in the setter.
Tags
GridView
Asked by
Wellpartner
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Wellpartner
Top achievements
Rank 1
Share this question
or