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

Disable new line when Enter key is pressed in RadMaskedTextInput

3 Answers 1001 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Sherwin
Top achievements
Rank 1
Sherwin asked on 16 Dec 2014, 08:47 PM
Hi,

Is there a way to disable the creation of new line when Enter key is pressed in RadMaskedTextInput?

Thanks,
Sherwin

3 Answers, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 19 Dec 2014, 12:41 PM
Hi Sherwin,

To disable the creation of a new line when you press the Enter key you can set the AcceptsReturn property of the masked input control to False.
<telerik:RadMaskedTextInput AcceptsReturn="False" />

I hope this helps.

Regards,
Martin
Telerik
 

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.

 
0
Sherwin
Top achievements
Rank 1
answered on 19 Dec 2014, 02:06 PM
Thanks for the reply. Indeed, setting AcceptsReturn to false will prevent creating new line but it still creates a new line when Ctrl + Enter keys are pressed. We used this key combination as a shortcut in our application. Is there a way to disable this?
0
Accepted
Petar Mladenov
Telerik team
answered on 24 Dec 2014, 12:26 PM
Hello Sherwin,

You can use the KeyDown event handler of the RadMaskedTextInput like so:
private void RadMaskedTextInput_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
      {
          if (e.Key == Key.Enter && Keyboard.Modifiers == ModifierKeys.Control)
          {
             e.Handled = true;
          }
      }
We hope this fits well in your scenario.

Regards,
Petar Mladenov
Telerik
 

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.

 
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Sherwin
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Sherwin
Top achievements
Rank 1
Petar Mladenov
Telerik team
Share this question
or