Please note that this control has been retired and is now obsolete to the XamDataGrid control, and as such, we recommend migrating to that control. It will not be receiving any new features, bug fixes, or support going forward. For help or questions on migrating your codebase to the XamDataGrid, please contact support.
You can enable the xamGrid column chooser feature by setting the ColumnChooserSettings or ColumnChooserSettingsOverride object’s AllowHideColumnIcon property to True. When your end user selects the column chooser icon that particular column will be hidden.
Setting the ColumnChooserSettings or ColumnChooserSettingsOverride object’s AllowHiddenColumnIndicator property to True will display an indicator in the adjacent column to the right of the hidden column. When this indicator is clicked, a drop-down appears with the hidden columns displayed. When your end user selects a column from this list, that column is no longer hidden.
For example, the following screenshot displays four column headers with the AllowHideColumnIcon property set to True and the AllowHiddenColumnIndicator property also set to True.
If your end user select to hide the ProductName column, the column chooser indictor is displayed, as shown in the following screenshot.
When your end user clicks on the column chooser indicator, a drop-down appears displaying a list of columns that are hidden directly to the left of the column indicator.
If your end user hides all columns, then the indicator will appear on the Filler column. For more information, see the Filler Column topic.
When your end user clicks the column chooser label, then the column chooser dialog window appears. For more information, see the Column Chooser Dialog Window topic.
The following code demonstrates how to enable the column chooser feature.
In XAML:
<ig:XamGrid Grid.Row="0" x:Name="MyDataGrid" ItemsSource="{Binding Source={StaticResource DataUtil}, Path=Products}" AutoGenerateColumns="False"> <ig:XamGrid.ColumnChooserSettings> <ig:ColumnChooserSettings AllowHideColumnIcon="True" AllowHiddenColumnIndicator="True"> </ig:ColumnChooserSettings> </ig:XamGrid.ColumnChooserSettings> <!-- TODO: Add Columns --> </ig:XamGrid>
In Visual Basic:
Me.MyDataGrid.ColumnChooserSettings.AllowHiddenColumnIndicator = True Me.MyDataGrid.ColumnChooserSettings.AllowHideColumnIcon = True
In C#:
this.MyDataGrid.ColumnChooserSettings.AllowHiddenColumnIndicator = true; this.MyDataGrid.ColumnChooserSettings.AllowHideColumnIcon = true;