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

RadGrid Password Field

1 Answer 249 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Silviu
Top achievements
Rank 1
Silviu asked on 27 Jun 2018, 09:56 AM
Is there a way to hide the text in a radGrid's cell so that it when it initially renders it is displayed as ********* and then when click on the cell to display it as plain text (without postback)?

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 02 Jul 2018, 05:54 AM
Hello Silviu,

Yes, you can achieve this requirement using different approaches:

1. Use textboxes in the ItemTemplate of a GridTemplateColumn with password mode enabled and upon user click change it to standard mode.

2. Use 2 elements, for example labels in the ItemTemplate, one to hold the hidden value and the other to display the readable value, and toggle their visibility on click action.

3. Use the ItemDataBound event handler to set the cell text to hidden value. Then, on click action access the cell, get the original field value using getDataKeyValue and display it to the user. For this approach, you will need to add the corresponding field to the ClientDataKeyNames collection:
https://docs.telerik.com/devtools/aspnet-ajax/controls/grid/rows/accessing-cells-and-rows#getdatakeyvalue

I hope this will prove helpful.

Regards,
Eyup
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
Grid
Asked by
Silviu
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or