Search code examples
asp.nettelerik

Allow enter key inside Rad Telerik Multiline Textbox


I want my Telerik Textbox to allow enter key inside it, it gets disabled when I use style. My code:-

      <telerik:RadTextBox ID="txtContent" TextMode="MultiLine" Width="300" Height="85px"
                            MaxLength="150" runat="server" EnableEmbeddedSkins="false" Skin="Parcs" Style="white-space: normal;">
                        </telerik:RadTextBox> 

Style="white-space: normal;" it is not allowing enter key inside textbox.

Thanks


Solution

  • For some reason white-space: normal styling doesn't work properly with RadTextBox's multiline mode (found in IE 11, not sure if exist in other browsers). Try using white-space: pre !important; instead:

    <telerik:RadTextBox ID="txtContent" TextMode="MultiLine" Width="300" Height="85px"
                        MaxLength="150" runat="server" EnableEmbeddedSkins="false" Skin="Parcs" 
                        Style="white-space: pre !important;">
    </telerik:RadTextBox> 
    

    Or use RadInput CSS class which refers to textarea and add pre setting there:

    .RadInput textarea {
        white-space: pre !important;
    }
    

    References:

    Enter key not work with radtextbox multiple line

    RadTextBox multiline problem in IE 11