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

Mask for GridMasked Column is not working

2 Answers 110 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Aayam
Top achievements
Rank 1
Aayam asked on 17 Feb 2010, 08:54 AM
Hi,

As per our requirement we are creating a Rad Grid programmatically(Telerik DLL Version 2009.3.1103.35).
We have added a GridMasked Column and provided it with data  that is alha numeric(String Datatype.eg  AC2334565).
The mask value is set to "(###) ## ###".
But when i execute the code this is not applied to the data and it show plain with formatting.
Here is my code snippet:
               objGridMaskedColumn = New Telerik.GridMaskedColumn
                With objGridMaskedColumn
                    .UniqueName = cColNameTelephone
                    .HeaderText = "Auth Code"
                    .DataField = "AuthCode"
                    .Mask = "(###) ## ###"
                End With
                gridSample.MasterTableView.Columns.Add(objGridMaskedColumn)

My requirement is that i need to store the data in the database with any format.But while displaying the same text on grid i want to apply formatting to it.As per my understanding GridMasked Column was for  that purpose.
The same can be seen in below demo for Masked Column: http://demos.telerik.com/aspnet-ajax/grid/examples/generalfeatures/columntypes/defaultcs.aspx


Any help is greatly appreciated.

Regards,
Aayam

2 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 22 Feb 2010, 12:22 PM
Hello Aayam,

The mask is applied in Edit mode only. You could use (if appropriate) the DataFormatString property to set your own custom formatting.

As to the aforementioned demo - if you look at the HomePhone field (Employees table in Northwind) you will notice that the values are already formatted according to that mask.

Custom Numeric Format Strings

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Aayam
Top achievements
Rank 1
answered on 27 Apr 2010, 06:27 AM
Hi Daniel,

Got it.:)
Made the changes and its working fine.
Thanks again for you help.

Regards,
Aayam Singh
Tags
Grid
Asked by
Aayam
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Aayam
Top achievements
Rank 1
Share this question
or