ShowFieldChooser(FieldLayout,Boolean,Boolean) Method

Displays a FieldChooser that allows the user to select which fields are displayed in the data presenter.
Public Overloads Sub ShowFieldChooser( _
   ByVal fieldLayout As FieldLayout, _
   ByVal allowFieldLayoutSelection As Boolean, _
   ByVal retainFieldChooser As Boolean _
public void ShowFieldChooser( 
   FieldLayout fieldLayout,
   bool allowFieldLayoutSelection,
   bool retainFieldChooser


Field layout for which the FieldChooser will be displayed. Can be null in which case the root field layout will be pre-selected and the user will be allowed to select a different field layout.
Specifies whether the user will be allowed to change the field layout and select fields of a different field layout.
Specifies whether the data presenter should retain the FieldChooser that's displayed so that it can reuse it the next time this method is called instead of having to create a new one. This also retains the state of the FieldChooser.

ShowFieldChooser displays a FieldChooser that allows the user to select which fields of the specified field layout are displayed in the data presenter. The FieldChooser control will be displayed using a Infragistics.Windows.Controls.ToolWindow.

You can control aspects of the FieldChooser by hooking into FieldChooserOpening event. The associated event args provides the instance of the FieldChooser that will be displayed as well as the ToolWindow that will be used to display it.

Note that if the fieldLayout parameter is specified, the fields of that field layout will be displayed in the FieldChooser. Otherwise the root field layout's fields will be displayed. The AllowFieldLayoutSelection parameter specifies whether the the user will be allowed to change the field layout and select fields of other field layouts. FieldChooser's FieldChooser.FieldGroupSelectorVisibility property will be initialized based on that parameter.

The following code calls an overload of ShowFieldChooser that displays the field chooser dialog for a specific field layout.

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

    Private Sub OnButtonClick(ByVal sender As Object, ByVal e As RoutedEventArgs)
        Dim customersFieldLayout As FieldLayout = _dataPresenter.FieldLayouts("Customers")

        Me._dataPresenter.ShowFieldChooser(customersFieldLayout, False, True, "Select Customer Fields to Display")
    End Sub
using Infragistics.Windows;
using Infragistics.Windows.Controls;
using Infragistics.Windows.Editors;
using Infragistics.Windows.DataPresenter;
using Infragistics.Windows.DataPresenter.Events;

		private void OnButtonClick( object sender, RoutedEventArgs e )
			FieldLayout customersFieldLayout = _dataPresenter.FieldLayouts["Customers"];

			this._dataPresenter.ShowFieldChooser( customersFieldLayout, false, true, "Select Customer Fields to Display" );

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