Learn how to say "no" to ugly apps with the new R1'18 Telerik release. Sign up for the webinar!

PivotGrid - Filtering

M-ClassL-ClassH-ClassB-ClassGrand Total
Black Total
Brown Total
Grand Total
81713751121 3313
821821878 2520
352356350 1058
344346583 1273
Page size:
Isolate this demo as a stand-alone application
  • About this demo
  • C#
  • VB

Filtering in RadPivotGrid is switched on/off by the AllowFiltering property. When turned on it will make RadPivotGrid display a tiny filter image beside each field’s name. This is the fields filter button which opens up the filter window. The latter allows the user to exclude data items based on unique key values or apply a wide range of filter operators that fall within two categories: Label and Value filters.

1. Label filters Label filters control which groups for a given field will remain in the pivot data view after grouping has been performed. If, in the current example, you need only the groups for the White color, you should apply an Equals label filter on the Color field.

2. Value filters Value filters, for their part, allow filtering operations to be performed on the aggregate results. If, again illustrating with the current example, you need only the data where the total Sum of Quantity for each Class does not exceed 5000 you should apply a value filter on the Class field with a LessThanOrEqual filter operator and the corresponding filter value.

3. Report filtersReport filters are applied on fields that do not participate in the grouping of the data but are still present in the underlying data source. Report filters allow the exclusion of selected field items from the data prior to its grouping. In order for a pivot grid field to become eligible for report filtering it should be added to RadPivotGrid’s fields collection as a PivotGridReportField. That will effectively make it part of the grid’s filter zone and make report filtering applicable to it. If, for example, you need to perform the grouping only on items which SafetyLevel is either 1000 or 800, you should apply the corresponding report filter to the SafetyLevel field in the filter zone of the grid.

  • DefaultVB.aspx
  • DefaultVB.aspx.vb
    • DefaultVB.aspx.vb
    • PivotGridDataSourceHelper.vb
<%@ Page Language="vb" AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb" Inherits="Telerik.PivotGrid.Examples.Filtering.DefaultVB" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head runat="server">
    <title>Telerik ASP.NET Example</title>
    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        <telerik:RadAjaxPanel ID="ajaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
           <telerik:RadPivotGrid RenderMode="Lightweight" AllowFiltering="true" Width="100%"
                AllowSorting="true" ID="RadPivotGrid1" AllowPaging="true" PageSize="10" runat="server">
                <DataCellStyle Width="100px" />
                <RowHeaderCellStyle Width="20%" />
                <ClientSettings Scrolling-AllowVerticalScroll="true">
                    <telerik:PivotGridReportFilterField DataField="SafetyLevel" UniqueName="SafetyLevel">
                    <telerik:PivotGridRowField DataField="Color" ShowGroupsWhenNoData="true" UniqueName="Color">
                    <telerik:PivotGridRowField DataField="Line" UniqueName="Line">
                    <telerik:PivotGridColumnField DataField="Class" SortOrder="Descending" UniqueName="Class">
                    <telerik:PivotGridAggregateField DataField="Quantity">

Find Assistance

Help Us Improve

Was this example helpful?