DataGridSelectionMode Enumeration
Silverlight
Specifies constants that define the DataGrid selection modes.
Namespace: System.Windows.Controls
Assembly: System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)
This enumeration is used by the DataGrid.SelectionMode property. You can programmatically allow single or multiple row selection by setting the DataGrid.SelectionMode property.
The following code example demonstrates how to use the DataGridSelectionMode enumeration. This example is part of a larger example available in the Walkthrough: Customizing the DataGrid Control Using Properties topic.
private void cbSelectionMode_Changed(object sender, RoutedEventArgs e) { CheckBox cb = sender as CheckBox; if (this.dataGrid1 != null) { if (cb.IsChecked == true) this.dataGrid1.SelectionMode = DataGridSelectionMode.Single; else if (cb.IsChecked == false) this.dataGrid1.SelectionMode = DataGridSelectionMode.Extended; } }
For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.