Controls - Do you include a "select all" checkBox on the top?
  v2.0 Posted at 24/02/2017 1:37 AM by Tiago Araujo

​​Do you have checkbox (on the top) that let users select or unselect all checkboxes underneath it? If you have a list of checkboxes, you are going to frustrate users unless you provide an easy way to select all. The best way to achieve this is to have a checkbox at the top.

Figure: Good Example - Hotmail does this
Figure: Google have done it a different way to provide multiple methods (All, All Read, All Unread, All Starred, and All Unstarred)
SQL Auditor
Figure: Bad Example - SQL Auditor - No CheckBox for users to perform a "select all"
SQL Auditor
Figure: Good Example - SQL Auditor - CheckBox at the top of the column
SQL Auditor
Figure: Selecting all does this - selects all
SQL Auditor
Figure: Deselecting all does this - selects none
SQL Auditor
Figure: Selecting some should show the Indeterminate check state - aka customized selection

Private Sub CheckBoxSelectAll_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles CheckBoxSelectAll.CheckedChanged
'Select checkbox in each row
For Each sDataGridViewRow As DataGridViewRow In Me.DataGridViewCustomer.Rows
sDataGridViewRow.Cells(0).Value = Me.CheckBoxSelectAll.Checked
End Sub

Code: Code for selecting all checkboxes in a windows form
Select all checkboxes in a web form
Figure: Select all checkboxes in a web form

<script type="text/javascript">
function SeleteCheckBox()
for (var n=0; n < document.form1.elements.length; n++)
if (document.form1.elements[n].type == "checkbox" && document.form1.elements[n].name == "gridview")
document.form1.elements[n].checked = document.getElementById("CheckBoxAll").checked;

Code: Code for selecting all checkboxes in a web form
We have suggestions for Visual Studio .NET about this at A top CheckBox to "select all" in windows forms and A top CheckBox to "select all" in web forms.

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address: