Explore the Top Microsoft SQLServer Technical/ Interview Questions here: http://Xplore2WinSqlServer.blogspot.com/
Explore the Top Microsoft C# Technical/ Interview Questions here: http://XploreCSharpDotNet.blogspot.com
Explore the Top Microsoft Blazor Technical/ Interview Questions here: https://XploreBlazor.blogspot.com/
Explore the Top Microsoft Blazor Technical/ Interview Questions here: https://XploreBlazor.blogspot.com/
Inorder to display the text, 'Yes' or 'No' instead of a checkbox, create the custom display template for boolean types as follows:
1. Create a folder called DisplayTemplates under the folder, ~/Views/Shared.
2. Create a file called Boolean.cshtml to have the following code:
@model System.Boolean?
@if (Model.HasValue)
{
if (Model.Value)
{
<text> Yes </text>
}
else
{
<text> No </text>
}
}
else
{
<text> </text>
}
Explore the Top Microsoft SQLServer Technical/ Interview Questions here: http://Xplore2WinSqlServer.blogspot.com/
Explore the Top Microsoft C# Technical/ Interview Questions here: http://XploreCSharpDotNet.blogspot.com
This comment has been removed by the author.
ReplyDeleteWorked like a charm!
ReplyDeleteVery simple, thank you!