[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications, and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Expand]Data Grid
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Collapse]Pivot Grid
   [Expand]Getting Started
   [Expand]Binding to Data
   [Collapse]Data Shaping
      Cell Editors Overview
      Assigning Editors to Data Field's Cells
      Assigning Editors to Individual Cells
      Assigning Editors for In-place Editing
      Preventing Editors from Being Activated
     Data Formatting
   [Expand]Data Analysis
   [Expand]Focus and Navigation
   [Expand]Printing and Exporting
   [Expand]Design-Time Features
   [Expand]UI Elements
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [Expand]Tree List
  [Expand]Gantt Control
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Preventing Editors from Being Activated

You can provide in-place editors for cells, as described in the Cell Editors Overview. In-place editors specify how cell values are represented on screen (in display mode). These editors also allow you to edit data. It's possible to disable the data editing and use in-place editors to represent cell values in read-only mode. To disable the data editing, you can use:

  • the PivotGrid control's PivotGridOptionsCustomizationEx.AllowEdit property.

    This allows you to disable data editing for all cells.

  • a data field's PivotGridFieldOptionsEx.AllowEdit property.

    This allows data editing to be disabled for cells corresponding to a specific Data Field.

  • the PivotGridControl.ShowingEditor event.

    This event allows you to disable data editing for particular cells. It fires when an in-place editor is about to be invoked. Setting the event's Cancel parameter to true prevents the editor from being invoked. The event's other parameters allow you to identify the currently processed cell, and determine when data editing should be disabled.

Expanded Example

The following code shows how to disable data editing for total cells. This is accomplished by handling the PivotGridControl.ShowingEditor event. When handling this event, the type of the current cell can be identified via the PivotCellEventArgsBase<TField, TData, TCustomTotal>.ColumnValueType (see PivotCellEventArgsBase<TField, TData, TCustomTotal>.ColumnValueType) and PivotCellEventArgsBase<TField, TData, TCustomTotal>.RowValueType (see PivotCellEventArgsBase<TField, TData, TCustomTotal>.RowValueType) parameters.

Is this topic helpful?​​​​​​​