ListBoxSelectionMode Property (GridTableOptionsStyleInfo)

Enables list box-like selection behavior for the grid when the user moves the current cell. When you set AllowSelection to GridSelectionFlags.None and specify ListBoxSelectionMode then a record-based selection mechanism is used. If you set this property to a value different from GridSelectionFlags.None a 2.x version compatible selection mechanism is used.
<DescriptionAttribute("Grid can emulated list boxes. This mode indicates if the list box is to be single-select, multi-select, or unselectable.")>
Public Property ListBoxSelectionMode As SelectionMode
Dim instance As GridTableOptionsStyleInfo
Dim value As SelectionMode
instance.ListBoxSelectionMode = value
value = instance.ListBoxSelectionMode
[Description("Grid can emulated list boxes. This mode indicates if the list box is to be single-select, multi-select, or unselectable.")]
public SelectionMode ListBoxSelectionMode {get; set;}

Property Value

A System.Windows.Forms.SelectionMode that defines the list box-like selection behavior of the grid.
Starting version 3.x the GridGroupingControl now supports multiple record selection and navigation across nested tables. In order to use the new record selection mechanism you need to set TableOptions.ListBoxSelection = SelectionMode.XYZ and make sure that TableOptions.AllowSelection = GridSelectionFlags.None. Optional settings can be specified with TableOptions.ListBoxSelectionColorOptions and TableOptions.ListBoxSelectionCurrentCellOptions.

With the new record-based selection mode selected records can be found in Table.SelectedRecords collection.

If you specify a different value for TableOptions.AllowSelection other than GridSelectionFlags.None the grid will operate in a backward-compatible mode and continue to use the old selection mechanism that was in place with 2.x and 1.x versions of the GridGroupingControl.

Use TableOptions.AllowSelection only if you explicitly want the old selection behavior, e.g. if you want to be able to select individual cells or want to use Excel-like selection behavior.

With the backward compatible selection mode selected rows and cells can be found in TableModel.Selections.Ranges collection.


Syncfusion.Grid.Grouping.Windows: 17.1460.0.47

See Also