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

masked text on a rad grid

4 Answers 191 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ivo
Top achievements
Rank 1
Ivo asked on 05 May 2008, 01:57 PM
Hello,
I would like to check if there is a direct way to display masked text on a rad grid.
There is a telerik:GridMaskedColumn, but it looks like it works only for edit mode. We can use template with RadMaskedTextBox control, but it doesn’t look consistent with the other columns.

Thanks,
Ivo

4 Answers, 1 is accepted

Sort by
0
Kiara
Top achievements
Rank 1
answered on 05 May 2008, 03:07 PM
Indeed the GridMaskedColumn type will filter the user entry when you edit a particular item in the grid. The other option I discovered is to put directly RadMaskedTextBox in item template of template column. Choose the approach in accordnace with your needs.

Kiara


0
Andy Green
Top achievements
Rank 1
answered on 05 May 2010, 01:04 PM
Hi

I have the same requirement - How was this solved in the end?

Andy
0
Veli
Telerik team
answered on 10 May 2010, 04:53 PM
Hello guys,

The most straightforward approach is to have a read-only RadMaskedTextBox in the ItemTemplate of a GridTemplateColumn, and an editable RadMaskedTextBox in the EditItemTemplate.

The other option to go with would be to use a regular GridMaskedColumn, but to manually mask your data values after the grid is bound. You can use RadGrid's ItemDataBound event for that:

protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        string originalValue = item["MaskedColumnUniqueName"].Text;
        //implement masking logic here and update originalValue to masked value
        item["MaskedColumnUniqueName"].Text = originalValue;
    }
}


Kind regards,
Veli
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
Andy Green
Top achievements
Rank 1
answered on 13 May 2010, 08:24 AM
Thanks

ANdy
Tags
Grid
Asked by
Ivo
Top achievements
Rank 1
Answers by
Kiara
Top achievements
Rank 1
Andy Green
Top achievements
Rank 1
Veli
Telerik team
Share this question
or