title: How to change boolean values datatable to understandable values in asp.net MVC?
body: <p>I've used <code>datatable</code> for showing my data.I want to change boolean values to understandable values for example, in my project I have two columns Gender and IsActive I want to change Gender with values Male and Female and also IsActive column.</p>
  
  <p><a href="https://i.stack.imgur.com/5VeiY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/5VeiY.png" alt="enter image description here"></a></p>
  
  <pre><code>@model  IEnumerable&lt;Dentistry.Areas.ViewModels.UserViewModel&gt;
  
  
  @{
      ViewBag.Title = "مدیریت کاربران";
  
  }
  
  @*&lt;h2&gt;مدیریت کاربران&lt;/h2&gt;*@
  
  @section Styles{
  
      &lt;link href="~/Areas/admin/assets/global/plugins/datatables/datatables.min.css" rel="stylesheet" type="text/css" /&gt;
      &lt;link href="~/Areas/admin/assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap-rtl.css" rel="stylesheet" type="text/css" /&gt;
      &lt;link href="~/Areas/admin/assets/global/plugins/bootstrap-modal/css/bootstrap-modal-bs3patch.css" rel="stylesheet" type="text/css" /&gt;
      &lt;link href="~/Areas/admin/assets/global/plugins/bootstrap-modal/css/bootstrap-modal.css" rel="stylesheet" type="text/css" /&gt;
  }
  
  &lt;style&gt;
      .table-checkable tr &gt; td:first-child, .table-checkable tr &gt; th:first-child {
          text-align: center;
          max-width: 50000px;
          min-width: 40px;
          padding-right: 0;
          padding-left: 0;
      }
      #delete .modal-header {
          border-bottom: 1px solid #EFEFEF;
          background: #e7505a !important;
      }
      .modal {
          border-radius: 0px;
          -webkit-border-radius : 0px;
          -moz-border-radius: 0px;
      }
  &lt;/style&gt;
  
  
  &lt;div class="col-md-12 col-sm-12"&gt;
      &lt;!-- BEGIN EXAMPLE TABLE PORTLET--&gt;
      &lt;div class="portlet box green"&gt;
          &lt;div class="portlet-title"&gt;
              &lt;div class="caption"&gt;
                  &lt;i class="fa fa-cogs"&gt;&lt;/i&gt;کاربران
              &lt;/div&gt;
              &lt;div class="actions"&gt;
                  &lt;a href="/Admin/Users/Create" data-target="#create" data-toggle="modal" class="btn btn-default btn-sm"&gt;
                      &lt;i class="fa fa-plus"&gt;&lt;/i&gt; کاربر جدید
                  &lt;/a&gt;
                  &lt;a href="javascript:;" class="btn btn-default btn-sm"&gt;
                      &lt;i class="fa fa-print"&gt;&lt;/i&gt; چاپ
                  &lt;/a&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="portlet-body"&gt;
              &lt;table class="table table-striped table-bordered table-hover table-checkable order-column myDatatable" id="myDatatable"&gt;
                  &lt;thead&gt;
                      &lt;tr&gt;
                          @*&lt;th class="table-checkbox"&gt;
                                  &lt;label class="mt-checkbox mt-checkbox-single mt-checkbox-outline"&gt;
                                      &lt;input type="checkbox" class="group-checkable" data-set="myDatatable .checkboxes" /&gt;
                                      &lt;span&gt;&lt;/span&gt;
                                  &lt;/label&gt;
                              &lt;/th&gt;*@
                          &lt;th&gt;نام کاربری &lt;/th&gt;
                          &lt;th&gt;نام &lt;/th&gt;
                          &lt;th&gt;نام خانوادگی&lt;/th&gt;
                          &lt;th&gt;جنسیت&lt;/th&gt;
                          &lt;th&gt;ایمیل&lt;/th&gt;
                          &lt;th&gt;وضعیت&lt;/th&gt;
                          &lt;th&gt;شماره تماس&lt;/th&gt;
                          &lt;th&gt;آدرس&lt;/th&gt;
                          &lt;th&gt;ویرایش&lt;/th&gt;
                          &lt;th&gt;حذف&lt;/th&gt;
                      &lt;/tr&gt;
                  &lt;/thead&gt;
  
  
              &lt;/table&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  
  
  &lt;div id="edit" class="modal fade" tabindex="-1" data-width="760"&gt;
      &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&lt;/button&gt;
          &lt;h3 class="modal-title"&gt;ویرایش کاربران&lt;/h3&gt;
      &lt;/div&gt;
     &lt;div class="modal-body"&gt;
          &lt;div class="row"&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;div id="delete" class="modal fade" tabindex="-1" data-width="760"&gt;
      &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&lt;/button&gt;
          &lt;h3 class="modal-title"&gt;آیا قصد حذف این کاربر را دارید؟&lt;/h3&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
          &lt;div class="row"&gt;
  
          &lt;/div&gt;
      &lt;/div&gt;
  
  &lt;/div&gt;
  
  &lt;div id="create" class="modal fade" tabindex="-1" data-width="760"&gt;
      &lt;div class="modal-header"&gt;
          &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;&lt;/button&gt;
          &lt;h4 class="modal-title"&gt;&lt;i class="fa fa-user-plus"&gt;&lt;/i&gt;   کاربر جدید &lt;/h4&gt;
      &lt;/div&gt;
      &lt;div class="modal-body"&gt;
  
  
      &lt;/div&gt;
  
  &lt;/div&gt;
  
      &lt;!-- BEGIN Portlet PORTLET--&gt;
  
      &lt;!-- END Portlet PORTLET--&gt;
  
  
  
  
  @section scripts{
  
  
      &lt;!-- BEGIN PAGE LEVEL PLUGINS --&gt;
      &lt;script src="~/Areas/admin/assets/global/scripts/datatable.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="~/Areas/admin/assets/global/plugins/datatables/datatables.min.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="~/Areas/admin/assets/global/plugins/datatables/plugins/bootstrap/datatables.bootstrap.js" type="text/javascript"&gt;&lt;/script&gt;
  
      &lt;script src="~/Areas/admin/assets/pages/scripts/table-datatables-managed.min.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;!-- END PAGE LEVEL SCRIPTS --&gt;
      &lt;script src="~/Areas/admin/assets/global/plugins/bootstrap-modal/js/bootstrap-modalmanager.js" type="text/javascript"&gt;&lt;/script&gt;
      &lt;script src="~/Areas/admin/assets/global/plugins/bootstrap-modal/js/bootstrap-modal.js" type="text/javascript"&gt;&lt;/script&gt;
  
      &lt;!-- BEGIN PAGE LEVEL SCRIPTS --&gt;
      &lt;script src="~/Areas/admin/assets/pages/scripts/ui-extended-modals.min.js" type="text/javascript"&gt;&lt;/script&gt;
  
      &lt;script&gt;
  
          $(document).ready(function () {
  
              var oTable = $('#myDatatable').DataTable({
                  "ajax": "/Users/GetUsers",
                  "language": {
                      "search": "جستجو:",
                      "lengthMenu": " تعداد _MENU_ رکورد در هر صفحه"
                  },
                  "autoWidth": true,
                  "columns": [
  
                      { "data": "UserName", },
                      { "data": "FirstName", },
                      { "data": "LastName", },
                      { "data": "Gender", },
                      { "data": "Email", },
                      { "data": "IsActive", },
                      { "data": "PhoneNumber", },
                      { "data": "Address", },
  
                      {
                          "data": "UserId", "width": "50px", "render": function (data) {
                              //
                              return '&lt;a class="btn btn-info fa fa-pencil" data-toggle="modal" data-dismiss="modal" data-target="#edit"  href="/Admin/Users/Edit/' + data + '"&gt;&lt;/a&gt;';
                          }
                      },
                      {
                          "data": "UserId", "width": "50px", "render": function (data) {
                              return '&lt;a class="btn btn-danger fa fa-trash" data-toggle="modal" data-dismiss="modal" data-target="#delete" href="/Admin/Users/Delete/' + data + '"&gt;&lt;/a&gt;';
                          }
                      }
                  ]
  
              });
  
              $('body').on('hidden.bs.modal', '.modal', function () {
  
                  $(this).removeData('bs.modal');
              });
  
          });
  
  
      &lt;/script&gt;
  }
  </code></pre>