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

Format gridview textbox cell value while typing.

1 Answer 183 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Evgeniy
Top achievements
Rank 1
Evgeniy asked on 24 Aug 2016, 06:55 PM

Hi,

I need to correctly format the phone number while user enter digits. Fixed mask is not sutable because the user can enter any number of any country.

I have a special method which takes a string and returns correctly forrmatted number, however, it is not possible to change cell's value in Edit Mode cathing ValueChanging event. Is it any workaround?

Best regards

Evgeny.

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Aug 2016, 06:31 AM
Hello Evgeniy,

Thank you for writing. 

GridViewMaskBoxColumn allows restricted editing of text/numeric data. It uses a RadMaskedEditBoxElement for the cell's editor. Thus, you can specify what mask to be followed including some optional digits as well. 

However, if you don't want to use a GridViewMaskBoxColumn, indeed handling the ValueChanging event may suit your custom scenario. Note that you shouldn't modify the cell's value, but the editor's value while editing. The editor's value will be committed when you press enter or focus some other element. Additional information about the available masks can be found here: http://docs.telerik.com/devtools/winforms/editors/maskededitbox/standard-masks

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
GridView
Asked by
Evgeniy
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or