This is a migrated thread and some comments may be shown as answers.

GridViewMaskedTextBoxColumn Display

3 Answers 83 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Bertha
Top achievements
Rank 1
Bertha asked on 13 Mar 2013, 08:32 PM
I want to mask the display, not just when the field is edited. How can I do it? Thanks.

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 14 Mar 2013, 07:00 AM
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.

0
Bertha
Top achievements
Rank 1
answered on 14 Mar 2013, 05:38 PM

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>
0
Dimitrina
Telerik team
answered on 19 Mar 2013, 02:13 PM
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.

Tags
GridView
Asked by
Bertha
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Bertha
Top achievements
Rank 1
Dimitrina
Telerik team
Share this question
or