Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [Expand]What's Installed
 [Expand]Common Concepts
 [Collapse]ASP.NET WebForms Controls
  [Expand]Reporting
  [Expand]Chart Control
  [Collapse]Grid View
   [Expand]Product Information
    Getting Started
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Binding to Data
    [Expand]Data Representation Basics
    [Expand]Focus and Navigation
    [Expand]Data Editing
    [Expand]Data Shaping and Manipulation
    [Collapse]Data Formatting
      Conditional Formatting
      Format Condition Types
      Formatting via Events
      Standard Formatting Mechanism
      Creating Conditional Formatting Rules
    [Expand]Master-Detail Relationship
     Appearance Customization
     Adaptivity
     Save and Restore Layout
    [Expand]Templates
     Export
     Toolbars
    [Expand]ASPxGridLookup
    ASPxGridView Designer
   [Expand]Visual Elements
   [Expand]Examples
   [Expand]Member Tables
   [Expand]ASPxGridView - Animated Images
  [Expand]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Expand]Site Navigation and Layout
  [Expand]File Management
  [Expand]Multi-Use Site Controls
  [Expand]Scheduler
  [Expand]HTML Editor
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gauges
  [Expand]Data Editors
  [Expand]Spell Checker
  [Expand]Query Builder
 [Expand]ASP.NET MVC Extensions
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Formatting via Events

ASPxGridView has three events that enable you to provide custom display text for individual group rows, data and summary cells. These are:

  • ASPxGridView.CustomColumnDisplayText - enables you to provide custom display text for any cell.

    Expanded Example 1

    This example demonstrates how to display the "empty" string within the Units On Order column's cells if they contain zero values.

    The image below shows the result:

  • ASPxGridView.CustomGroupDisplayText - allows you to provide custom content for individual group rows.

    Expanded Example 2

    This example demonstrates how to implement custom grouping. The data is grouped by the 'Unit Price' column, and the column's rows that have values between 0 and 10 are combined into a single group. Rows whose values fall between 10 and 20 are combined into another group, etc.

    The 'Unit Price' column's GridDataColumnSettings.SortMode property is set to 'Custom', and the ASPxGridView.CustomColumnGroup and ASPxGridView.CustomColumnSort events are handled identically.

    Additionally, the ASPxGridView.CustomGroupDisplayText event is handled to replace the default text displayed within group rows.

    The image below shows the result.

    Note

    Refer to the How to implement custom grouping logic for ASPxGridView columns online example to review how it works.

  • ASPxGridView.SummaryDisplayText - enables custom display text to be provided for any total or group summary value.

How would you rate this topic?​​​​​​​