Skip to main content

PivotGridExtension.GetDataObject(PivotGridSettings, Object, Boolean) Method

Generates a chart data source from regular data.

Namespace: DevExpress.Web.Mvc

Assembly: DevExpress.Web.Mvc5.v26.1.dll

Declaration

public static object GetDataObject(
    PivotGridSettings pivotGridSettings,
    object dataSource,
    bool applyClientState
)

Parameters

Name Type Description
pivotGridSettings PivotGridSettings

A PivotGridSettings object that specifies pivot grid settings that define how to generate a chart data source.

dataSource Object

A PivotGrid data source.

applyClientState Boolean

A Boolean value that specifies whether to apply the pivot grid’s client state to a chart data source.

Returns

Type Description
Object

A chart data source.

Remarks

Use the static GetDataObject method in the controller to create a model for a Chart extension and pass it to the corresponding view.

The GetDataObject method internally creates a Pivot Grid extension based on the specified settings, binds it to the specified data source, and returns the chart data source generated by that Pivot Grid.

To create a chart data source from OLAP data, use a GetDataObject method overload that accepts an olapConnectionString parameter. When the Pivot Grid uses server mode, use the PivotGridExtension.GetEFDataObject or PivotGridExtension.GetLINQDataObject method, depending on the data provider type.

Note

Use the applyClientState method parameter to apply the Pivot Grid’s client state to a chart data source. If you do not specify this parameter, the client state is ignored during a postback.

You can use the PivotGridSettings.BeforeGetDataObject property to apply custom settings to the PivotGrid before a Chart data source is generated but after the PivotGrid’s callback state is applied.

See Also