Version

DisplayHiddenFieldsOnly Property

Specifies whether to display only the hidden fields or all fields.
Syntax
'Declaration
 
Public Property DisplayHiddenFieldsOnly As Boolean
public bool DisplayHiddenFieldsOnly {get; set;}
Remarks

DisplayHiddenFieldsOnly property specifies whether the FieldChooser displays only the hidden fields or all fields. When this property is set to True, FieldChooser displays only the fields that are not currently displayed in the data presenter. When this property is set to False, all fields are displayed.

When displaying all fields, each field displays a checkbox next to it that controls the visibility of the field. When displaying only the hidden fields, these check boxes are not be displayed. In either mode, the user can hide a field from the data presenter by dragging it from the data presenter and dropping it over the FieldChooser or any area outside of the data presenter. Likewise the user can unhide a field by dragging it from the FieldChooser and dropping it inside the data presenter. Furthermore the user can choose the drop the field at a specific location in the field layout area, in the same way when moving a field via drag-and-drop, to position it at a specific location relative to other fields in the field layout area.

Note that you can exclude specific fields from being displayed in the FieldChooser by setting the Field's FieldSettings.AllowHiding property.

Example
The following code snippet enables the field chooser button in the data presenter and sets some of the commonly used properties in the FieldChooserOpening event. When the field chooser button is clicked, the data presenter displays a field chooser and raises the FieldChooserOpening event which lets you set properties on the field chooser that's about to be displayed.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Windows
Imports Infragistics.Windows.Controls
Imports Infragistics.Windows.Editors
Imports Infragistics.Windows.DataPresenter
Imports Infragistics.Windows.DataPresenter.Events

    Private Sub Dp_FieldChooserOpening(ByVal sender As Object, ByVal e As FieldChooserOpeningEventArgs)
        Dim fieldChooser As FieldChooser = e.FieldChooser

        ' If the data presenter is bound to a hierarchical data source, a combo editor
        ' is displayed in the field chooser that lets the user select the field-layout
        ' whose fields to be display in the field chooser. You can hide this combo
        ' by setting the FieldGroupSelectorVisibility property.
        fieldChooser.FieldGroupSelectorVisibility = Visibility.Collapsed

        ' By defaults all fields are displayed in the field chooser. If you only want 
        ' to display hidden fields in the field chooser, set DisplayHiddenFieldsOnly
        ' to true, which will as a result also remove the checkboxes next to items.
        fieldChooser.DisplayHiddenFieldsOnly = False

        ' By defaults fields are displayed in alphabetical order. You can also display
        ' the fields in the same order as they appear in the data presenter by setting
        ' the FieldDisplayOrder property to SameAsDataPresenter.
        fieldChooser.FieldDisplayOrder = FieldChooserDisplayOrder.Alphabetical
    End Sub
using Infragistics.Windows;
using Infragistics.Windows.Controls;
using Infragistics.Windows.Editors;
using Infragistics.Windows.DataPresenter;
using Infragistics.Windows.DataPresenter.Events;

		private void dp_FieldChooserOpening( object sender, FieldChooserOpeningEventArgs e )
		{
			FieldChooser fieldChooser = e.FieldChooser;

			// If the data presenter is bound to a hierarchical data source, a combo editor
			// is displayed in the field chooser that lets the user select the field-layout
			// whose fields to be display in the field chooser. You can hide this combo
			// by setting the FieldGroupSelectorVisibility property.
			fieldChooser.FieldGroupSelectorVisibility = Visibility.Collapsed;

			// By defaults all fields are displayed in the field chooser. If you only want 
			// to display hidden fields in the field chooser, set DisplayHiddenFieldsOnly
			// to true, which will as a result also remove the checkboxes next to items.
			fieldChooser.DisplayHiddenFieldsOnly = false;

			// By defaults fields are displayed in alphabetical order. You can also display
			// the fields in the same order as they appear in the data presenter by setting
			// the FieldDisplayOrder property to SameAsDataPresenter.
			fieldChooser.FieldDisplayOrder = FieldChooserDisplayOrder.Alphabetical;
		}
This XAML snippet sets the HeaderPrefixAreaDisplayMode property to enable field chooser button and hooks into the FieldChooserOpening event.
<igDP:XamDataGrid x:Name="_dp" FieldChooserOpening="dp_FieldChooserOpening" >
            
<igDP:XamDataGrid.FieldLayoutSettings>
                
<igDP:FieldLayoutSettings HeaderPrefixAreaDisplayMode="FieldChooserButton" />
            
</igDP:XamDataGrid.FieldLayoutSettings>
</igDP:XamDataGrid>
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also