RadGrid Password Field

2 posts, 0 answers
  1. Silviu
    Silviu avatar
    63 posts
    Member since:
    Feb 2015

    Posted 27 Jun 2018 Link to this post

    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)?
  2. Eyup
    Eyup avatar
    4046 posts

    Posted 02 Jul 2018 Link to this post

    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:

    I hope this will prove helpful.

    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.
Back to Top