RadWindow.ResponseButton="Accept" & a multiline TextBox

2 posts, 0 answers
  1. Valeriu
    Valeriu avatar
    21 posts
    Member since:
    Dec 2010

    Posted 04 Apr 2012 Link to this post

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

    <TextBox Text="Text here"
             Margin="10" />

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

    <telerik:RadButton Content="Save"

    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.


     - Is it a programmed/known behavior? 

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


  2. Konstantina
    Konstantina avatar
    2332 posts

    Posted 06 Apr 2012 Link to this post

    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.

    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top