GridViewMaskedTextBoxColumn Display

4 posts, 0 answers
  1. Bertha
    Bertha avatar
    89 posts
    Member since:
    Aug 2012

    Posted 13 Mar 2013 Link to this post

    I want to mask the display, not just when the field is edited. How can I do it? Thanks.
  2. Vlad
    Admin
    Vlad avatar
    11100 posts

    Posted 14 Mar 2013 Link to this post

    Hello,

     Have you tried to use StringFormat property of the column DataMemberBinding? 

    All the best,
    Vlad
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Bertha
    Bertha avatar
    89 posts
    Member since:
    Aug 2012

    Posted 14 Mar 2013 Link to this post

    I tried                 
    <telerik:GridViewMaskedTextBoxColumn Header="Password" DataMemberBinding="{Binding Password}" MaskType="None" Mask="####" DataFormatString="{}{0:####}"  />

    Now, both display and edit did not mask. I want to allow 4 digit or character entered into this column.  Display and edit mode both are masked with #.

    <telerik:RadGridView Name="myGrid" Grid.Row="1" AutoGenerateColumns="False" DataLoadMode="Asynchronous" CanUserReorderColumns="False"
                    IsFilteringAllowed="False" Margin="10,5,5,15" ShowGroupPanel="False" CanUserDeleteRows="True" IsReadOnly="False"
                    RowEditEnded="myGrid_RowEditEnded_1" Deleted="myGrid_Deleted_1">
                <telerik:RadGridView.Columns>
                     <telerik:GridViewDataColumn Header="User Name" DataMemberBinding="{Binding UserName}"  />
                    <telerik:GridViewMaskedTextBoxColumn Header="Password" DataMemberBinding="{Binding Password}" MaskType="None" Mask="####" DataFormatString="{}{0:####}"  />
                    </telerik:GridViewColumn>
                </telerik:RadGridView.Columns>
            </telerik:RadGridView>
  4. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 19 Mar 2013 Link to this post

    Hello,

    The mask in edit mode does not work as you have set MaskType="None", please set it to "Standard" instead. If you have entered 4 symbols, then four symbols will be displayed in View mode.

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top