Back to Devexpress

PivotGridFieldBase.Visible Property

corelibraries-devexpress-dot-xtrapivotgrid-dot-pivotgridfieldbase-92200998.md

latest6.8 KB
Original Source

PivotGridFieldBase.Visible Property

Gets or sets whether the field is visible.

Namespace : DevExpress.XtraPivotGrid

Assembly : DevExpress.PivotGrid.v25.2.Core.dll

NuGet Packages : DevExpress.PivotGrid.Core, DevExpress.Win.Navigation

Declaration

csharp
[DefaultValue(true)]
public virtual bool Visible { get; set; }
vb
<DefaultValue(True)>
Public Overridable Property Visible As Boolean

Property Value

TypeDefaultDescription
Booleantrue

true if the field is visible; false otherwise.

|

Remarks

If a field is hidden it can still be accessed via the Customization form. To prevent a hidden field from being displayed within the Customization form set its PivotGridFieldOptions.ShowInCustomizationForm property to false.

The following code snippets (auto-collected from DevExpress Examples) contain references to the Visible property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-pivot-grid-connect-to-an-olap-datasource/CS/WinOlapRetrieveFieldsExample/Form1.cs#L33

csharp
pivotGridControl1.Fields["[Customer].[Country].[Country]"].Area = PivotArea.RowArea;
pivotGridControl1.Fields["[Customer].[Country].[Country]"].Visible = true;
pivotGridControl1.Fields["[Customer].[City].[City]"].Area = PivotArea.RowArea;

winforms-pivot-create-user-folders-within-the-customization-form/CS/XtraPivotGrid_UserFolders/Form1.cs#L22

csharp
fieldSalesPerson1.DisplayFolder = "Employees";
fieldSalesPerson1.Visible = false;

web-forms-pivot-grid-change-summary-display-mode/CS/SummaryDisplayMode/Default.aspx.cs#L44

csharp
if(SourceDataField != null)
    cbShowRawValues.Checked = SourceDataField.Visible;
ConfigureSummaryDisplayTypeComboBox(SelectedGroup);

winforms-pivotgrid--display-the-difference-of-income-and-outlay-in-totals/CS/PivotGridCustomSummaryExample/CustomSummaryHelper.cs#L23

csharp
{
    if (!groupField.Visible || groupField.Area == PivotArea.FilterArea || groupField.Area == PivotArea.DataArea)
        return true;

winforms-pivot-totals-visibility/CS/Form1.cs#L30

csharp
for(int i = 0; i < pivotGridControl.Fields.Count; i++) {
    if(pivotGridControl.Fields[i].Visible && pivotGridControl.Fields[i].Area == field.Area
        && pivotGridControl.Fields[i].AreaIndex > field.AreaIndex)

winforms-pivot-grid-connect-to-an-olap-datasource/VB/WinOlapRetrieveFieldsExample/Form1.vb#L34

vb
pivotGridControl1.Fields("[Customer].[Country].[Country]").Area = PivotArea.RowArea
pivotGridControl1.Fields("[Customer].[Country].[Country]").Visible = True
pivotGridControl1.Fields("[Customer].[City].[City]").Area = PivotArea.RowArea

winforms-pivot-create-user-folders-within-the-customization-form/VB/XtraPivotGrid_UserFolders/Form1.vb#L24

vb
fieldSalesPerson1.DisplayFolder = "Employees"
fieldSalesPerson1.Visible = False

web-forms-pivot-grid-change-summary-display-mode/VB/SummaryDisplayMode/Default.aspx.vb#L67

vb
cbAllowCrossGroupVariation.Visible = isVariation
If SourceDataField IsNot Nothing Then cbShowRawValues.Checked = SourceDataField.Visible
ConfigureSummaryDisplayTypeComboBox(SelectedGroup)

winforms-pivotgrid--display-the-difference-of-income-and-outlay-in-totals/VB/PivotGridCustomSummaryExample/CustomSummaryHelper.vb#L23

vb
Public Shared Function ShouldCalculateCustomValue(ByVal groupField As PivotGridField, ByVal e As PivotGridCustomSummaryEventArgs) As Boolean
    If Not groupField.Visible OrElse groupField.Area = PivotArea.FilterArea OrElse groupField.Area = PivotArea.DataArea Then
        Return True

winforms-pivot-totals-visibility/VB/Form1.vb#L34

vb
For i As Integer = 0 To pivotGridControl.Fields.Count - 1
    If pivotGridControl.Fields(i).Visible AndAlso pivotGridControl.Fields(i).Area = field.Area AndAlso pivotGridControl.Fields(i).AreaIndex > field.AreaIndex Then
        Return False

See Also

PivotGridFieldBase Class

PivotGridFieldBase Members

DevExpress.XtraPivotGrid Namespace