'Declaration Public Property AllowHiding As AllowFieldHiding
public AllowFieldHiding AllowHiding {get; set;}
AllowHiding property determines whether the user can show or hide a field. It also controls whether the field is displayed in the field chooser. If set to Never then the field is excluded from the field chooser and the user is not allowed to show or hide the field in any way.
If set to ViaFieldChooserOnly, the user can show or hide a field through the field chooser control only.
If set the Always, in addition to being able to show or hide via field chooser control, the user can hide a field by dragging it outside of the data presenter.
Imports Infragistics.Windows Imports Infragistics.Windows.Controls Imports Infragistics.Windows.Editors Imports Infragistics.Windows.DataPresenter Imports Infragistics.Windows.DataPresenter.Events Private Sub Dp_FieldLayoutInitialized(ByVal sender As Object, ByVal e As FieldLayoutInitializedEventArgs) If Object.Equals(e.FieldLayout.Key, "Customers") Then ' Set AllowHiding to prevent the field from being displayed in the field ' chooser. This effectively prevents the user from changing the visibility ' of the field. e.FieldLayout.Fields("CustomerID").Settings.AllowHiding = AllowFieldHiding.Never End If 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_FieldLayoutInitialized( object sender, FieldLayoutInitializedEventArgs e ) { if ( object.Equals( e.FieldLayout.Key, "Customers" ) ) { // Set AllowHiding to prevent the field from being displayed in the field // chooser. This effectively prevents the user from changing the visibility // of the field. e.FieldLayout.Fields["CustomerID"].Settings.AllowHiding = AllowFieldHiding.Never; } }
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