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

RadWindow.ResponseButton="Accept" & a multiline TextBox

1 Answer 132 Views
Window
This is a migrated thread and some comments may be shown as answers.
Valeriu
Top achievements
Rank 1
Valeriu asked on 04 Apr 2012, 09:01 AM

I have on a dialog a multiline TextBox where I want to capture some text. 

<TextBox Text="Text here"
         AcceptsReturn="True"
         TextWrapping="Wrap"
         Height="60"
         Margin="10" />

The Save button on that dialog has the ResponceButton property set to Accept.

<telerik:RadButton Content="Save"
                   telerik:RadWindow.ResponseButton="Accept"
                   />

The problem:

 - when I focus on TextBox and try to enter a multiline text (press Enter) the RadWindow.ResponceButton's action is fired. I've been thinking that setting AcceptsReturn should catch the Enter before the dialog, but that's not the case.

Questions:

 - Is it a programmed/known behavior? 

 - How can I work around this feature to get the user to enter a multiline text?

Thanks!

1 Answer, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 06 Apr 2012, 02:15 PM
Hello Valeriu,

The ResponseButton functionality is not designed to work with multi-line TextBox. You have to implement the logic for handling the Enter key yourself. Hook to the KeyDown event of the TextBox and check if the pressed key is Enter and if the focus is in the TextBox. If not, press the Save button.

Hope this information helps.

Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Tags
Window
Asked by
Valeriu
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Share this question
or