This is a migrated thread and some comments may be shown as answers.
RadMaskedTextBox: Multiline mask
9 Answers 76 Views
This is a migrated thread and some comments may be shown as answers.
Ferdinand van der Veen
Top achievements
Rank 1
Ferdinand van der Veen asked on 28 Feb 2011, 03:21 PM
I would like to use the RadMaskedTextBox in the following scenario:

My user has a multiline textbox in which he can enter text. This text has a maximum length per line and
must match certain criteria. In this  case it can be any character. When I set the text property of my
maskedtextbox the only thing that appears is my mask. I already tried to set the defaultmask, but when
the user clicks the textbox the default mask is applied. How  should I use the RadMaskedTextBox.
The code I am using is posted below

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" />
         
        <telerik:RadMaskedTextBox
            Width="300px"
            Height="80px"
            ID="RadMaskedTextBox1"
            runat="server"
            Label="Masked"
            TextMode="MultiLine"
            Mask = "aaa\r\naaa"
            TextWithLiterals = "123\r\n456"
            />
         
        <br />
        <telerik:RadTextBox
            Width="300px"
            Height="80px"
            ID="RadTextBox1"
            runat="server"
            Label="Normal"
            TextMode="MultiLine"
            Text = "123 456"
        />
    </div>
    </form>
</body>
</html>

9 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 01 Mar 2011, 09:46 AM
Hello,

Check out the following help article which describes how can create multi-line  RadMaskedTextBox.
Multi-Line Text Boxes

Thanks,
Shinu.
0
Ferdinand van der Veen
Top achievements
Rank 1
answered on 01 Mar 2011, 11:22 AM
I already tried that, but with no succes. My problem is that when my user types some text, saves it and then want to edit it, all text in the MaskedTextBox is gone. When I save the page again, it is also gone in the database. I tried to reproduce it by making a simple page with just two textboxes on it and setting the text.
0
Nikita Gourme
Top achievements
Rank 1
answered on 04 Mar 2011, 01:52 PM
What do you mean by "my user types, saves the text and then edits it"? What the save process is, is it some kind of your custom saving or you rely on the viewstate of the controls when the page is posted to the server? Shedding more light would be useful for further advice.
0
Ferdinand van der Veen
Top achievements
Rank 1
answered on 07 Mar 2011, 11:29 AM
I save the contents of the MaskedTextbox to a database. When I check the record in the database it's correctly saved (the value in the database is the same as the value I entered). For instance I type:

line1
line2


When I use the setValue property of the MaskedTextbox, the only thing that shows is the Mask. The text is correctly read from the database (I checked that with a breakpoint), but nothing appears in the MaskedTextbox. When I store the value of the MaskedTextbox again, it's stored as an empty value.
0
Radoslav
Telerik team
answered on 10 Mar 2011, 09:20 AM
Hello Ferdinand,

Could you please post your aspx page markup code with the related javascript code and code behind file. Thus we will be able to gather more details about your scenario, create a simple project based on your code and provide you with more to-the-point answer.

Looking forward for your reply.

All the best,
Radoslav
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
Eric
Top achievements
Rank 1
answered on 15 Mar 2011, 04:56 PM
Hi,

I cannot set the Text property of the below RadMaskedTextBox control in the code behind if the TextMode is MultiLine. If the TextMode is SingleLine it works well.
<telerik:RadMaskedTextBox ID="txtPhone" Runat="server"
    Height="100px" EmptyMessage="Contact Phones" Width="500px"
    TextMode="MultiLine" Mask="Phone1: (###) ###-####    Phone2: (###) ###-####  \r\nPhone3: (###) ###-####    Phone4: (###) ###-####  \r\nPhone5: (###) ###-####    Phone6: (###) ###-####  \r\nPhone7: (###) ###-####    Phone8: (###) ###-####  \r\nPhone9: (###) ###-####" Rows="3">
</telerik:RadMaskedTextBox>

txtPhone.Text = "123456789012345678901234567890";

Thank you...
0
Radoslav
Telerik team
answered on 18 Mar 2011, 09:23 AM
Hi Eric,

I tested the scenario which you describe and I reproduced the unwanted behaviour. Our developers are aware and they will start working on the resolution of this issue.

Best wishes,
Radoslav
the Telerik team
0
Eric
Top achievements
Rank 1
answered on 12 Apr 2011, 10:29 AM
Hi, when is the bug fix scheduled? Is it going to be in the next release?

Thank you...
0
Radoslav
Telerik team
answered on 12 Apr 2011, 01:53 PM
Hello Eric,

Our developer fixed the described issue and the SP1, which will be released till the end of the week contains the fix.
On the following links you could find instructions how to use the hotfix dlls and how to upgrade Telerik's RadControls to another version:
http://www.telerik.com/help/aspnet-ajax/installusinghotfix.html
http://www.telerik.com/support/kb/aspnet-ajax/general/updating-radcontrols-for-asp-net-to-another-version-or-license.aspx

Greetings,
Radoslav
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Input
Asked by
Ferdinand van der Veen
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Ferdinand van der Veen
Top achievements
Rank 1
Nikita Gourme
Top achievements
Rank 1
Radoslav
Telerik team
Eric
Top achievements
Rank 1
Share this question
or