Skip to content

Commit

Permalink
[DataGrid] Fix showColumnVerticalBorder prop (#16715)
Browse files Browse the repository at this point in the history
  • Loading branch information
KenanYusuf authored Feb 25, 2025
1 parent 98e2985 commit 5269b07
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ export const useGridColumnHeaders = (props: UseGridColumnHeadersProps) => {
pinnedPosition,
indexInSection,
sectionLength,
rootProps.showCellVerticalBorder,
rootProps.showColumnVerticalBorder,
gridHasFiller,
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ export const useGridColumnHeaders = (props: UseGridColumnHeadersProps) => {
pinnedPosition,
indexInSection,
sectionLength,
rootProps.showCellVerticalBorder,
rootProps.showColumnVerticalBorder,
gridHasFiller,
);

Expand Down Expand Up @@ -443,7 +443,7 @@ export const useGridColumnHeaders = (props: UseGridColumnHeadersProps) => {
pinnedPosition,
indexInSection,
visibleColumnGroupHeader.length,
rootProps.showCellVerticalBorder,
rootProps.showColumnVerticalBorder,
gridHasFiller,
)}
/>
Expand Down
26 changes: 26 additions & 0 deletions test/regressions/data-grid/DataGridBorderedCells.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import * as React from 'react';
import { DataGridPro } from '@mui/x-data-grid-pro';
import { randomTraderName, randomEmail } from '@mui/x-data-grid-generator';

const columns = [
{ field: 'name', headerName: 'Name', width: 160 },
{ field: 'email', headerName: 'Email', width: 200 },
{ field: 'age', headerName: 'Age', type: 'number' },
];

const rows = [
{
id: 1,
name: randomTraderName(),
email: randomEmail(),
age: 25,
},
];

export default function DataGridBordered() {
return (
<div style={{ height: 400, width: '100%' }}>
<DataGridPro rows={rows} columns={columns} showCellVerticalBorder />
</div>
);
}
26 changes: 26 additions & 0 deletions test/regressions/data-grid/DataGridBorderedColumns.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import * as React from 'react';
import { DataGridPro } from '@mui/x-data-grid-pro';
import { randomTraderName, randomEmail } from '@mui/x-data-grid-generator';

const columns = [
{ field: 'name', headerName: 'Name', width: 160 },
{ field: 'email', headerName: 'Email', width: 200 },
{ field: 'age', headerName: 'Age', type: 'number' },
];

const rows = [
{
id: 1,
name: randomTraderName(),
email: randomEmail(),
age: 25,
},
];

export default function DataGridBordered() {
return (
<div style={{ height: 400, width: '100%' }}>
<DataGridPro rows={rows} columns={columns} showColumnVerticalBorder />
</div>
);
}

0 comments on commit 5269b07

Please sign in to comment.