Format gridview textbox cell value while typing.

2 posts, 0 answers
  1. Evgeniy
    Evgeniy avatar
    1 posts
    Member since:
    Aug 2016

    Posted 24 Aug Link to this post

    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.

  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 26 Aug Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top