In general, the MaskedTextBox widget is designed to work with a mask with a static length. That being said, you will need to define a mask that matches the max length of the number you would like to support. For instance, if you would like to support numbers from 1 to 99999, then the mask should look like this:
I would like to suggest you use the NumericTextBox widget with hidden up/down arrows
Let me know if I am missing something.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.