Export (0) Print
Expand All
Expand Minimize

DataGridRowDetailsVisibilityMode Enumeration

Specifies constants that define when DataGrid row details are displayed.

Namespace:  System.Windows.Controls
Assembly:  System.Windows.Controls.Data (in System.Windows.Controls.Data.dll)

public enum DataGridRowDetailsVisibilityMode
<object property = "enumMemberName"/>

Member nameDescription
CollapsedThe row details section is not displayed for any rows.
VisibleThe row details section is displayed for all rows.
VisibleWhenSelectedThe row details section is displayed only for selected rows.

This enumeration is used by the DataGrid.RowDetailsVisibilityMode property. You can programmatically show or hide the row details section for individual rows by setting the row DetailsVisibility property.

The following code example demonstrates how to use the DataGridRowDetailsVisibilityMode enumeration. This example is part of a larger example available in the How to: Display and Configure Row Details in the DataGrid Control topic.


// Set the row details visibility to the option selected in the combo box.
private void cbRowDetailsVis_SelectionChanged(object sender, RoutedEventArgs e)
{
    ComboBox cb = sender as ComboBox;
    ComboBoxItem cbi = cb.SelectedItem as ComboBoxItem;
    if (this.dataGrid1 != null)
    {
        if (cbi.Content.ToString() == "Selected Row (Default)")
            dataGrid1.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.VisibleWhenSelected;
        else if (cbi.Content.ToString() == "None")
            dataGrid1.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.Collapsed;
        else if (cbi.Content.ToString() == "All")
            dataGrid1.RowDetailsVisibilityMode = DataGridRowDetailsVisibilityMode.Visible;
    }
}


Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft