Public Class PrettyCheckboxField
    Inherits System.Web.UI.WebControls.BoundField

    Protected Overrides Sub InitializeDataCell(cell As DataControlFieldCell, rowState As DataControlRowState)
        MyBase.InitializeDataCell(cell, rowState)
        Dim lit As New Literal()
        AddHandler lit.DataBinding, New EventHandler(AddressOf OnDataBindField)
        cell.Controls.Add(lit)
    End Sub

    Protected Overrides Sub OnDataBindField(sender As Object, e As EventArgs)
        If TypeOf sender Is Literal Then
            Dim lit = CType(sender, Literal)
            Dim dataValue = GetValue(sender.NamingContainer)
            If IsDBNull(dataValue) Then
                lit.Text = ""
            ElseIf CBool(dataValue) = True Then
                lit.Text = "<i class='fas fa-check-circle' style='color: green' />"
            ElseIf CBool(dataValue) = False Then
                lit.Text = "<i class='far fa-circle' style='color: gray' />"
            End If
        End If
    End Sub

End Class
