Back to Devexpress

FixedFieldValue Class

corelibraries-devexpress-dot-xtrapivotgrid-ad97f371.md

latest3.4 KB
Original Source

FixedFieldValue Class

A column field value to be pinned.

Namespace : DevExpress.XtraPivotGrid

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

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

Declaration

csharp
public class FixedFieldValue :
    IXtraSupportDeserializeCollectionItem,
    IFixedFieldValue
vb
Public Class FixedFieldValue
    Implements IXtraSupportDeserializeCollectionItem,
               IFixedFieldValue

Remarks

To pin a column, follow the steps below:

  1. Create a FixedFieldValue object.
  2. Assign a DataField to the FixedFieldValue.DataField property. If the Pivot Grid control displays multiple data fields, pick a field whose values should be pinned.
  3. Create a FixedFieldValueCondition and specify a column area field and its value. This information, together with the data field, indicates the column that should be pinned.
  4. Add the created condition to the Conditions collection.
  5. Add the created FixedFieldValue object to the PivotGridControl.FixedColumnFieldValues collection.

The code snippet below illustrates how to pin the fieldQuantity field values that belong to the February 2015 interval.

csharp
using DevExpress.XtraPivotGrid;

//...

public Form1() {
var info = new FixedFieldValue(fieldQuantity);
info.Conditions.Add(
    new FixedFieldValueCondition(fieldYear, new DateTime(2015, 2, 1)));
pivotGridControl1.FixedColumnFieldValues.Add(info);
}
vb
Imports DevExpress.XtraPivotGrid

'...

Public Sub New()
Dim info = New FixedFieldValue(fieldQuantity)
info.Conditions.Add(New FixedFieldValueCondition(fieldYear, New DateTime(2015, 2, 1)))
pivotGridControl1.FixedColumnFieldValues.Add(info)
End Sub

If you specify no conditions, the “Grand Total” column is pinned.

csharp
pivotGridControl1.FixedColumnFieldValues.Add(new FixedFieldValue(fieldQuantity));
vb
pivotGridControl1.FixedColumnFieldValues.Add(New FixedFieldValue(fieldQuantity))

Implements

IXtraSupportDeserializeCollectionItem

Inheritance

Object FixedFieldValue

See Also

FixedFieldValue Members

DevExpress.XtraPivotGrid Namespace