Version

We recommend that you use the xamDataGrid control instead of the xamGrid control. The xamGrid is being planned for retirement over the next few years and will not receive any new features. We will continue to provide support and critical bug fixes for the xamGrid during this time. For help or questions on migrating your codebase to the xamDataGrid, please contact support.

Prevent Columns from Being Hidden

If you enable the column chooser functionality or if you programmatically display the column chooser, your end users will be able to a hide a column using one of the following methods:

  • Click the column chooser icon on the column’s header.

  • From the column chooser dialog window, select the column’s corresponding check box.

However, you can prevent your end users from hiding a column altogether by setting the ColumnBase object’s IsHideable to False. By default, this property is set to True. When this property is set to False, the column chooser icon will not appear in that particular column’s header and the checkbox in the column chooser dialog will be disabled.

Note
Note:

This is strictly a UI limiting property, you can still change the visibility in the code-behind.

In the following screenshot, the CategoryID column is disabled.

xamGrid columnChooser6.png

The following example code demonstrates how to prevent columns from being hidden.

In XAML:

<ig:TextColumn IsHideable=" Key="CategoryID"/>

In C#:

this.MyDataGrid.Columns.DataColumns["CategoryID"].IsHideable = false;

In Visual Basic:

Me.MyDataGrid.Columns.DataColumns("CategoryID").IsHideable = True