Skip to content

Group by custom cell component losing the custom component #3318

Open

Description

@ofirrifo

Describe the bug

When I group by custom cell component it lose the custom component and it just show value.

To Reproduce

Take a look on the example
There is custom cell that represent colors and once I group by this column I lose the custom cell component and just see the value

Link to code example: example

Expected behavior

Environment

  • react-data-grid ^7.0.0-beta.36:
  • react/react-dom 18.2.0:

Additional context

Activity

  1. RahulARanger commented on May 12, 2024

    @RahulARanger

    you can try the renderGroupCell prop in columns. once you group by cell, grouped column will have grouped cell.

    in your src.App.tsx you can add these lines (for example)

    export function ColorGroupedCell(props: any) {
      return (
        <div style={{ backgroundColor: props.childRows[0].color }}>{props.childRows[0].color}</div>
      );
    }
    
    export const columns: Column<Row>[] = [
      { key: 'id', name: 'ID', sortable: true },
      { key: 'name', name: 'name' },
      { key: 'color', name: 'color', renderCell: ColorCell , renderGroupCell: ColorGroupedCell},
    ];
  2. added theissue type on Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions