ComponentOne List for WinForms
In This Topic
    Selection
    In This Topic

    List supports various ways of item selection through mouse or keyboard. Let us explore these ways.

    Selection Modes

    By default, List allows selection of an entire row or column by clicking the corresponding header. However, the default behavior can be changed to allow selection in units of rows, columns, etc., by using SelectionMode property of the C1List class. The property accepts values from the SelectionModeEnum enumeration. 

    The following table provides a brief description and a quick snapshot of how selection looks like in each of these modes.

    Selection Mode Description Snapshot
    Default Allows selection of an entire row or column by clicking the corresponding header. One Selection mode
    One Allows selection of one list item. One Selection mode
    MultiExtended Allows selection of multiple list items by pressing the Shift key. Multi Extended Selection mode
    Checkbox Allows selecion of list items using checkboxs. Checkbox selection mode
    MultiSimple Allows selection of non-contiguous list items and returns a bookmark for the selected row. MultiSimple selection mode

    The following code snippet demonstrates how to enable checkbox selection by setting SelectionMode to Checkbox.

    C#
    Copy Code
    c1List1.SelectionMode = C1.Win.List.SelectionModeEnum.CheckBox;