Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
134
how to write IP address mask?
posted

I want to mask IP address.how to implement?

the following is my implement,but it is failed:

mask :{number:0-255}.{number:0-255}.{number:0-255}.{number:0-255}

input : 10.23.222.12

output:102.322.212.  (it is not my expected result)

 

Parents
  • 2070
    posted

    Hi Daniel,

     

    I just created a small sample to try your mask out and it works for me. I get the expected output. Here's what I'm using to test it out:

     

                <ige:XamMaskedEditor x:Name="maskedEditor"  Mask="{}{number:0-255}.{number:0-255}.{number:0-255}.{number:0-255}" />

                <TextBox Grid.Row="1" Text="{Binding ElementName=maskedEditor, Path=Value}" />

     

    Basically the text box displays the correct expected value that's entered int the masked editor. Can you provide any more info on any other settings on the masked editor or how you are making use of it? It would be best if you could attach a small sample that demonstrates the issue so we can check it out.

     

    As a side note, try setting the AllowShiftingAcrossSections property to false. You don't have to do it if you are using number sections as you are, but for other textual masks with multiple sections, to prevent text shifting across sections, you would have to set this.

     

    Thanks, 

    Sandip 

     

  • 134
    posted in reply to [Infragistics] Sandip Patel

    Sandip ,

    thank you for your comments.I set AllowShiftingAcrossSections property to false,but this issue is still existent.The following is my xaml:

    <Window x:Class="MaskTypeTest.Window2"
        xmlns="
    http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        xmlns:igEditors="http://infragistics.com/Editors"
        Title="Mask Test" Height="300" Width="500">
        <Grid>
            <Grid.RowDefinitions >
                <RowDefinition ></RowDefinition>
                <RowDefinition Height="30"></RowDefinition>
                <RowDefinition ></RowDefinition>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions >
                <ColumnDefinition Width="150"></ColumnDefinition>
                <ColumnDefinition Width="150"></ColumnDefinition>
                <ColumnDefinition ></ColumnDefinition>
            </Grid.ColumnDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Center">Mask:</TextBlock >
            <TextBox Name="txtMask" Grid.Row="0" Grid.Column="1" Width="150" VerticalAlignment="Bottom" HorizontalAlignment="Center"/>
            <TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Bottom" HorizontalAlignment="Center">Test Mask:</TextBlock >
            <igEditors:XamMaskedEditor Grid.Row="1" Grid.Column="1" VerticalAlignment="Bottom"   x:Name="maskedEditor2"
        ValueType="{x:Type sys:String}"
        Mask="{Binding ElementName=txtMask ,Path = Text}"
        DataMode="Raw"
        DisplayMode="IncludeBoth"
        AllowShiftingAcrossSections ="False"                               
        >
                <igEditors:XamMaskedEditor.ValueConstraint>
                    <igEditors:ValueConstraint Nullable="True" />
                </igEditors:XamMaskedEditor.ValueConstraint>
            </igEditors:XamMaskedEditor>
        </Grid>
    </Window>

Reply Children