# Showing Password fields in the Grid

## Environment

<table>
 <tr>
  <td>Product</td>
  <td>Progress Telerik UI for ASP.NET MVC Grid</td>
 </tr>
 <tr>
  <td>Progress Telerik UI for ASP.NET MVC version</td>
  <td>Created with the 2023.2.718 version</td>
 </tr>
</table>

## Description

How can I show textual password fields in a safe manner in the boundaries of a Telerik UI for ASP.NET MVC Grid?

## Solution

To achieve the desired scenario:

1. Create a common function that will be responsible for altering each of the characters for the required field.
2. Utilize the [`Columns.Bound.ClientTemplate()`](https://docs.telerik.com/aspnet-mvc/api/kendo.mvc.ui.fluent/gridboundcolumnbuilder#clienttemplatesystemstring) configuration method of the Grid and utilize the conventional hash Syntax that is accustomed for the [`Kendo Templating`](https://docs.telerik.com/kendo-ui/framework/templates/overview) mechanism.

```Razor Index.cshtml
    @(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.EmployeeViewModel>()
            .Name("grid")
            .Columns(columns =>
            {
                columns.Bound(e => e.FirstName).Width(110);
                columns.Bound(e => e.LastName).Width(110);
                columns.Bound(e => e.Country).Title("Password").ClientTemplate("#=replaceString(Country)#").Width(110);
                columns.Bound(e => e.City).Width(110);
                columns.Bound(e => e.Title);

            })
            .Sortable()
            .Pageable()
            .DataSource(dataSource => dataSource
                .Ajax()
                .PageSize(5)
                .Read(read => read.Action("HierarchyBinding_Employees", "Grid"))
            )
    )
```

```JS script.js
    <script>
        function replaceString(value){
            value = value.split('').map(function(character){
                return '*';
            }).toString().replace(/,/g , '');

            return value;
        }
    </script>
```

For the complete implementation of the suggested approach, refer to the [Telerik REPL example on showing all password fields in the Grid](https://netcorerepl.telerik.com/QHkBwbFx28JNZxtL00).

## More ASP.NET MVC Grid Resources

* [ASP.NET MVC Grid Documentation](https://www.telerik.com/aspnet-mvc/documentation/html-helpers/data-management/grid/overview)

* [ASP.NET MVC Grid Demos](https://demos.telerik.com/aspnet-mvc/grid/index)

* [ASP.NET MVC Grid Product Page](https://www.telerik.com/aspnet-mvc/grid)

* [Telerik UI for ASP.NET MVC Video Onboarding Course (Free for trial users and license holders)](https://www.telerik.com/aspnet-mvc/documentation/getting-started/video-onboarding)

* [Telerik UI for ASP.NET MVC Forums](https://www.telerik.com/forums/aspnet-mvc)

## See Also

* [Client-Side API Reference of the Grid  for ASP.NET MVC](https://docs.telerik.com/kendo-ui/api/ui/grid)
* [Server-Side API Reference of the Grid  for ASP.NET MVC](https://docs.telerik.com/aspnet-mvc/api/grid)
* [Telerik REPL: Show Password fields in the Grid](https://netcorerepl.telerik.com/QHkBwbFx28JNZxtL00)
* [Telerik UI for ASP.NET MVC Breaking Changes](https://www.telerik.com/aspnet-mvc/documentation/backwards-compatibility/2023-backwards-compatibility)
* [Telerik UI for ASP.NET MVC Knowledge Base](https://docs.telerik.com/aspnet-mvc/knowledge-base)
