diff --git a/packages/x-data-grid/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx b/packages/x-data-grid/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx index d72882be1754..2e9804d6c51f 100644 --- a/packages/x-data-grid/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx +++ b/packages/x-data-grid/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx @@ -456,7 +456,7 @@ export const useGridColumnHeaders = (props: UseGridColumnHeadersProps) => { fields={headerInfo.fields} colIndex={headerInfo.colIndex} depth={depth} - isLastColumn={headerInfo.colIndex === visibleColumns.length - headerInfo.fields.length} + isLastColumn={index === visibleColumnGroupHeader.length - 1} maxDepth={headerGroupingMaxDepth} height={dimensions.groupHeaderHeight} hasFocus={hasFocus}