RadPivotGrid
RadPivotGrid is a control which provides functionality similar to the functionality of PivotTables in MS Excel. It aggregates large chunks of data and displays them in a human readable way.
Definition
Namespace:Telerik.WinControls.UI
Assembly:Telerik.WinControls.PivotGrid.dll
Syntax:
[TelerikToolboxCategory("Data Controls")]
public class RadPivotGrid : RadControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, INotifyPropertyChanged, ISupportInitializeNotification, ISupportInitialize, IComponentTreeHandler, ILayoutHandler, IAnalyticsProvider, IPrintable, IChartDataProvider
Inheritance: objectMarshalByRefObjectComponentControlScrollableControlRadControlRadPivotGrid...
Implements:
Inherited Members
Constructors
Initializes a new instance of the RadPivotGrid class with default settings. Creates an empty pivot grid control that can be configured to display aggregated data from various data sources.
public RadPivotGrid()
Properties
A collection of PropertyAggregateDescription which describes how the values in the cells are calculated (aggregated).
[Browsable(true)]
public AggregateDescriptionsCollection AggregateDescriptions { get; }
Gets or sets the depth of the Aggregates groups among the other groups when more than one aggregate is used.
[Browsable(true)]
public int AggregatesLevel { get; set; }
Gets or sets the axis of the Aggregates groups when more than one aggregate is used.
[Browsable(true)]
public PivotAxis AggregatesPosition { get; set; }
Gets or sets a value indicating whether the built-in context menu is enabled.
public bool AllowContextMenu { get; set; }
Gets or sets a value indicating whether the built-in screen tips are enabled.
public bool AllowDefaultScreenTips { get; set; }
Gets or sets a value indicating whether fields can be dragged and dropped between different areas of the pivot grid. When enabled, users can reorganize the pivot layout by moving fields between row, column, value and filter areas.
[Browsable(true)]
public bool AllowFieldsDragDrop { get; set; }
Gets or sets a value indicating whether Group Filtering is enabled.
public bool AllowGroupFiltering { get; set; }
Gets or sets a value indicating whether the user is able to resize columns.
public bool AllowHorizontalResize { get; set; }
Gets or sets a value indicating whether the user is able to select cells.
public bool AllowSelection { get; set; }
Gets or sets a value indicating whether the user is able to sort the group labels.
public bool AllowSorting { get; set; }
Gets or sets a value indicating whether the user is able to resize rows.
public bool AllowVerticalResize { get; set; }
Gets or sets a value indicating whether the created column groups should be initially expanded.
public bool AutoExpandColumnHeaders { get; set; }
Gets or sets a value indicating whether the newly created row groups should be initially expanded.
public bool AutoExpandRowHeaders { get; set; }
Gets or sets the chart data provider.
[Browsable(true)]
public PivotGridChartDataProvider ChartDataProvider { get; set; }
The chart data provider.
Gets or sets the position of the GrandTotal column in the Columns axis.
[Browsable(true)]
public TotalsPos ColumnGrandTotalsPosition { get; set; }
A collection of PropertyGroupDescriptionBase which is used for generating column groups.
[Browsable(true)]
public ColumnGroupDescriptionCollection ColumnGroupDescriptions { get; }
Gets or sets the behavior that will set the expand or collapse state for column IGroups.
[Browsable(false)]
public IItemExpandBehavior<ExpandBehaviorParameters> ColumnGroupsExpandBehavior { get; set; }
Gets or sets the height of the column headers area.
public int ColumnHeaderHeight { get; set; }
Gets or sets the layout type of the column headers.
[Browsable(true)]
public PivotLayout ColumnHeadersLayout { get; set; }
Gets or sets the position of the SubTotal columns in the Columns axis.
[Browsable(true)]
public TotalsPos ColumnsSubTotalsPosition { get; set; }
Gets or sets the default column width for all columns.
public int ColumnWidth { get; set; }
Gets or sets the name of the list or table in the data source for which RadPivotGrid is displaying aggregated data.
[Browsable(true)]
public string DataMember { get; set; }
Gets or sets the IDataProvider that populates the pivot grid with data.
[Browsable(false)]
public IDataProvider DataProvider { get; set; }
Gets or sets the data source for which RadPivotGrid is displaying aggregated data.
public object DataSource { get; set; }
Gets the default size of the control.
protected override Size DefaultSize { get; }
The default Size of the control.
Overrides:
DialogsFactory
PivotGridDialogsFactory
Gets or sets the dialogs factory.
[Browsable(false)]
public PivotGridDialogsFactory DialogsFactory { get; set; }
The dialogs factory.
Gets or sets the string that will appears on cells that do not have a value.
public string EmptyValueString { get; set; }
Gets or sets the string that will appears on cells for which an error has occured during calculation.
public string ErrorString { get; set; }
Gets or sets the height of the report filters area.
public int FilterAreaHeight { get; set; }
A collection of PropertyFilterDescription which defines the fields that are available in the Report Filters area.
[Browsable(true)]
public FilterDescriptionsCollection FilterDescriptions { get; }
Gets the pivot grid element.
[Browsable(false)]
public RadPivotGridElement PivotGridElement { get; }
The pivot grid element.
Gets or sets the PivotGridPrintStyle that is responsible for printing the pivot grid.
[Browsable(true)]
public PivotGridPrintStyle PrintStyle { get; set; }
Gets or sets the position of the GrandTotal row in the Rows axis.
[Browsable(true)]
public TotalsPos RowGrandTotalsPosition { get; set; }
A collection of PropertyGroupDescriptionBase which is used for generating row groups.
[Browsable(true)]
public RowGroupDescriptionCollection RowGroupDescriptions { get; }
Gets or sets the behavior that will set the expand or collapse state for row IGroups.
[Browsable(false)]
public IItemExpandBehavior<ExpandBehaviorParameters> RowGroupsExpandBehavior { get; set; }
Gets or sets the layout type of the row headers.
[Browsable(true)]
public PivotLayout RowHeadersLayout { get; set; }
Gets or sets the position of the SubTotal rows in the Rows axis.
[Browsable(true)]
public TotalsPos RowsSubTotalsPosition { get; set; }
Gets or sets a value indicating whether the Report Filters area should be displayed.
[Browsable(true)]
public bool ShowFilterArea { get; set; }
Gets or sets the serialization information for RadPivotGrid used by SaveLayout and LoadLayout methods to persist and restore grid settings. By default or when set to null, the ComponentXmlSerializationInfo provided by GetDefaultXmlSerializationInfo() will be used.
[Browsable(false)]
public ComponentXmlSerializationInfo XmlSerializationInfo { get; set; }
Methods
Signals the start of the control's initialization and suspends layout and data updates. Used during control creation and when loading the control state from a serialized form.
public override void BeginInit()
Overrides:
Puts RadPivotGrid in update mode and suspends visual refreshing. Use this method before making multiple property changes to improve performance by preventing multiple layout updates. Must be paired with a subsequent call to EndUpdate() when finished making changes.
public void BeginUpdate()
Creates the child elements for the RadPivotGrid control. Initializes the pivotGridElement and adds it to the parent's collection.
protected override void CreateChildItems(RadElement parent)
The parent element that will contain the created child elements.
Overrides:
Creates the RadPivotGridElement which is the main visual element of the pivot grid control. Override this method to create a custom pivot grid element when inheriting from RadPivotGrid.
protected virtual RadPivotGridElement CreatePivotGridElement()
A new instance of RadPivotGridElement that will be used to render the pivot grid.
Creates the XML serializer used for saving and loading the pivot grid's layout. Override this method to provide custom serialization behavior when extending this control.
protected virtual ComponentXmlSerializer CreateXmlSerializer(ComponentXmlSerializationInfo info)
The serialization information that defines which properties to serialize.
Returns:A ComponentXmlSerializer instance that will handle the actual serialization.
Signals the end of the control's initialization and resumes layout and data updates. The control will be refreshed to reflect all changes made during initialization.
public override void EndInit()
Overrides:
Ends the update mode and refreshes the pivot grid's visual representation. Call this method after BeginUpdate() once you've finished making property changes to apply all pending updates at once.
public void EndUpdate()
Gets the default serialization information for RadPivotGrid used by SaveLayout and LoadLayout methods to persist and restore grid settings to/from XML. This includes configuration of rows, columns, aggregates, filters, and appearance settings.
protected virtual ComponentXmlSerializationInfo GetDefaultXmlSerializationInfo()
A ComponentXmlSerializationInfo instance configured with the default settings for RadPivotGrid serialization.
Loads the RadPivotGrid's layout configuration from an XML stream. Restores group configurations, column widths, row heights, and other display settings from the provided stream.
public virtual void LoadLayout(Stream stream)
The stream containing the saved layout information.
Loads the RadPivotGrid's layout configuration from an XML file. Restores group configurations, column widths, row heights, and other display settings from the specified file.
public virtual void LoadLayout(string fileName)
The path to the file containing the saved layout information.
Loads the RadPivotGrid's layout configuration from an XML reader. Restores group configurations, column widths, row heights, and other display settings from the provided XML reader.
public virtual void LoadLayout(XmlReader xmlReader)
The XmlReader containing the saved layout information.
Raises the KeyDown event.
protected override void OnKeyDown(KeyEventArgs e)
A KeyEventArgs that contains the event data.
Overrides:
Raises the MouseDown event.
protected override void OnMouseDown(MouseEventArgs e)
A MouseEventArgs that contains the event data.
Overrides:
Raises the MouseMove event.
protected override void OnMouseMove(MouseEventArgs e)
A MouseEventArgs that contains the event data.
Overrides:
Raises the event.
protected override void OnMouseUp(MouseEventArgs e)
The MouseEventArgs instance containing the event data.
Overrides:
Raises the MouseWheel event.
protected override void OnMouseWheel(MouseEventArgs e)
A MouseEventArgs that contains the event data.
Overrides:
Called when the screen tip is needed.
protected override void OnScreenTipNeeded(object sender, ScreenTipNeededEventArgs e)
The sender.
eScreenTipNeededEventArgsThe ScreenTipNeededEventArgs instance containing the event data.
Overrides:
Directly prints the RadPivotGrid to the default printer without showing any printer settings dialog. This is a convenience method that uses the current default printer with default settings.
public virtual void Print()
Prints the RadPivotGrid using a specified print document and with an option to display the printer settings dialog.
public virtual void Print(bool showPrinterSettings, RadPrintDocument document)
When true, displays the printer settings dialog before printing; when false, prints directly using default settings.
documentRadPrintDocumentAn instance of RadPrintDocument used to control the print process and settings.
Prints the RadPivotGrid with an option to display the printer settings dialog first.
public virtual void Print(bool showPrinterSettings)
When true, displays the printer settings dialog before printing; when false, prints directly using default settings.
Opens a print preview dialog that allows viewing and adjusting how the pivot grid will appear when printed. This method creates a new RadPrintDocument with default settings.
public virtual void PrintPreview()
Opens a print preview dialog that allows viewing and adjusting how the pivot grid will appear when printed. This overload uses a specified RadPrintDocument for more control over the printing process.
public virtual void PrintPreview(RadPrintDocument document)
An instance of RadPrintDocument used to control the print process and settings.
Recalculates all the aggregated data and refreshes the visual representation of the pivot grid. Use this method when the underlying data source has changed and you need to update the pivot grid.
public void ReloadData()
Saves the RadPivotGrid's current layout configuration to a stream in XML format. This includes group configurations, column widths, row heights, and other display settings. The stream remains open after the operation completes.
public virtual void SaveLayout(Stream stream)
The stream where the layout information will be written.
Saves the RadPivotGrid's current layout configuration to a file in XML format. This includes group configurations, column widths, row heights, and other display settings.
public virtual void SaveLayout(string fileName)
The path to the file where the layout information will be saved.
Saves the RadPivotGrid's current layout configuration to XML format. This includes properties like group configurations, column widths, row heights, and other display settings.
public virtual void SaveLayout(XmlWriter xmlWriter)
The XmlWriter used to write the serialized layout data.
Shows the Field Chooser dialog which allows users to select and organize fields in the pivot grid. Users can drag fields to different areas (row fields, column fields, data fields, or filter fields) to reorganize the pivot grid.
public void ShowFieldList()
Events
Fires when an aggregate descriptor element is being created. Allows for replacing it with a custom element.
public event AggregateDescriptorElementCreatingEventHandler AggregateDescriptorElementCreating
Fires when the aggregate position element is being created. Allows for replacing it with a custom element.
public event AggregatesPositionElementCreatingEventHandler AggregatesPositionElementCreating
Fires when a cell element is being created. Allows for replacing the default elements with custom ones.
public event PivotCellCreatingEventHandler CellCreating
Fires when a cell element is updated. Allows for customizing the appearance of the cells.
public event PivotCellEventHandler CellFormatting
Fires when the DataProvider property has changed.
public event DataProviderChangedEventHandler DataProviderChanged
Fires when a filter descriptor element is being created. Allows for replacing it with a custom element.
public event FilterDescriptorElementCreatingEventHandler FilterDescriptorElementCreating
Fires when a group descriptor element is being created. Allows for replacing it with a custom element.
public event GroupDescriptorElementCreatingEventHandler GroupDescriptorElementCreating
Fires when a group element is being created. Allows for replacing the default group elements.
public event PivotGroupElementCreatingEventHandler GroupElementCreating
Fires when a group element is updated. Allows for customizing its appearance.
public event PivotGroupElementEventHandler GroupElementFormatting
Fires when a group is expanded or collapsed.
public event PivotGroupEventHandler GroupExpandedChanged
Fires when a print element is being prepared for painting.
public event PrintElementEventHandler PrintElementFormatting
Fires when the print element has been painted. Allows for adding custom painting.
public event PrintElementPaintEventHandler PrintElementPaint
Fires when a row element is being created. Allows for replacing the default elements with custom ones.
public event PivotRowCreatingEventHandler RowCreating
Fires when a row element is updated.
public event PivotRowEventHandler RowFormatting
Fires when the selection in RadPivotGrid has changed.
public event EventHandler SelectionChanged
Fires when the data provider has finished building the data and the UI was updated.
public event EventHandler UpdateCompleted