DevExtreme v24.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React Data Grid - Cell Customization

DataGrid allows you to modify cell style settings and custom paint cells in a PDF document.

Use the customizeCell function to customize the appearance settings of DataGrid cells in a PDF document. For example, you can change the text alignment and the background color of cells. The following function parameters are available:

  • gridCell
    Contains information about the source DataGrid cell.
  • pdfCell
    Contains settings applied to a cell in a PDF document.
To give you the ability to edit code on the fly, the demo uses SystemJS. For this reason, launching the demo takes some time. We strongly recommend that you do not use this approach in real projects.
Backend API

In this demo, the customizeCell function changes the following elements:

  • Background color and font weight of group row cells
  • Font style of a footer cell

The customDrawCell function allows you to draw cells in a PDF document. The following parameters are available when you use this function:

  • doc
    An instance of the jsPDFDocument object.
  • rect
    A cell’s bounds.
  • gridCell
    Contains information about the source DataGrid cell.
  • pdfCell
    Contains settings applied to a cell in a PDF document.
  • cancel
    Set this parameter to true to prevent default painting logic.

This demo uses the customDrawCell function to paint cells in the "Website" column.