Welcome to the Xceed Community | Help
Community Search  
More Search Options

Unable to set MaskedTextBox text values from Button EventHanlder in Code Behind.

Sort Posts: Previous Next
  •  02-24-2009, 3:16 AM Post no. 18826

    Unable to set MaskedTextBox text values from Button EventHanlder in Code Behind.

    Typically I perform the following code to update a textbox via some buttons.

    Private Sub ButtonDialPad1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)

    MaskedTextBoxPhoneNumber.Text = MaskedTextBoxPhoneNumber.Text & "2"

    End Sub

    Now that we have implemented the MaskedTextBox this funcitonallity doesnt work. I wanted to know how I could code this?

    Here is my MaskedTextBox:

    <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1" Margin="10">

    <xcdg:MaskedTextBox

     

    Name="MaskedTextBoxPhoneNumber"

    PromptChar="_"

    Mask="\(000\)000\-0000\"

    IncludeLiteralsInValue="True"

    AllowPromptAsInput="True"

    RejectInputOnFirstFailure="False"

    Height="20" Width="85"

    Tag="{Binding ElementName=ListBoxDirectory, Path=Text}"

    xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid"></xcdg:MaskedTextBox>

  •  02-24-2009, 8:56 AM Post no. 18847 in reply to 18826

    Re: Unable to set MaskedTextBox text values from Button EventHanlder in Code Behind.

    Is the MaskedTextBox in a CellEditor or is it located outside the grid? Do you have errors in the output window? Are getting an exception? I will need more information in order to provide you with a solution.
    Senior Technical Writer
    - Xceed Software

    In three words I can sum up everything I've learned about life: it goes on.
View as RSS news feed in XML
Contact | Site Map | Reviews | Legal Terms of Use | Trademarks | Privacy Statement Copyright 2011 Xceed Software Inc.