vendredi 5 février 2016

DataGridViewCheckBoxColumn Change CheckBox Display

I have a DataGridview which lets the user do an assignment (room -> activity) with Checkboxes.

Each column represents a room. Each row represents an activity.

It is completly working. Now I want to make the CheckBoxes look better (thick green tick for True, thick red x for False) to make it more comfortable for the user to get an overview. The tick and the x can be everything they need to be; simple ascii characters or images - Whatever gets it working.

The following code is used for creating the DataGridViewCheckBoxColumns.

For Each row As DataRow In dt_rooms.Rows
        Dim a As DataGridViewCheckBoxColumn = New DataGridViewCheckBoxColumn(False)
        a.FlatStyle = FlatStyle.Popup
        a.CellTemplate = New DataGridViewCheckBoxCell()
        a.ToolTipText = row.Item("room")
        a.Name = row.Item("room")
        a.CellTemplate.Style.SelectionBackColor = Color.White
        dgv.Columns.Add(a)
    Next




Aucun commentaire:

Enregistrer un commentaire