We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

MaskedEditTextBox Problem

Thread ID:

Created:

Updated:

Platform:

Replies:

93692 Mar 29,2010 03:43 PM Apr 15,2010 12:58 AM ASP.NET Web Forms (Classic) 5
loading
Tags: Tools
RODRIGO QUIJANO
Asked On March 29, 2010 03:43 PM

hello good afternoon.

I have a problem with a type MaskedEditTextBox ItemTemplate.
I have this element in a ToolBar with other Componenet.
The problem is I can not get the value that is written in this
mask field. The same toolbar I have a normal textbox, this element
I get the value that is easily written as follows:

texto = ((TextBox)(Barra1.Controls[1].Controls[1].FindControl("txtBox1"))).Text;

But to find the value of MaskedEditTextBox always returns empty.

texto = ((Syncfusion.Web.UI.WebControls.Shared.MaskedEditTextBox)(Barra1.Controls[1].Controls[1].FindControl("txtMaskNumeric"))).Value;

As commentary, the Toolbar is a component that I created and use it in all my pages.

Lakxman Kumar C [Syncfusion]
Replied On April 5, 2010 09:19 AM

Hi Rodrigo,

Thank you for your interest in Syncfusion Products.

When the maskedit is inside the Toolbar as template, the ID will be generated on the fly. So, the maskedit can only be accessed by iterating the template list for the presence of the maskedit text box and its 'Text' property will give the text of the MaskEditTextbox. Please try this and let me know if any concerns.

Regards,
Lakxman Kumar C

RODRIGO QUIJANO
Replied On April 5, 2010 01:33 PM

The property 'Text' also returns empty.

RODRIGO QUIJANO
Replied On April 5, 2010 02:39 PM

Sorry. Misunderstood the first time. How do I scan the components of the toolbar?

RODRIGO QUIJANO
Replied On April 5, 2010 02:58 PM

foreach (Control control in Barra1.Controls[1].Controls[1].Controls)
if (control is Syncfusion.Web.UI.WebControls.Shared.MaskedEditTextBox)
{
String fr=((Syncfusion.Web.UI.WebControls.Shared.MaskedEditTextBox)control).Text;
}



I find the component, but the property 'Text' me back empty. I have to scan or otherwise?

Lakxman Kumar C [Syncfusion]
Replied On April 15, 2010 12:58 AM

Hi Rodrigo,

Thank you for your update.

The MaskEditTextBox added as a template control can be accessed by calling the button click method at the MaskEditTextBox's onLoad and then casting the sender as MaskEditTextBox. From then the Text property of the template mask edit can be obtained using the 'Text' property. Kindly refer the code snippet below.

[C#]

protected void Button1_Click(object sender, EventArgs e)
{
if (sender.GetType().FullName != "System.Web.UI.WebControls.Button")
{
mymask = sender as MaskedEditTextBox;
}
Label1.Text = mymask.Text;
}


Kindly try the above code and please let me know if you have any other queries.

Regards,
Lakxman Kumar C

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;