Skip to content

Commit 5269b07

Browse files
authored
[DataGrid] Fix showColumnVerticalBorder prop (#16715)
1 parent 98e2985 commit 5269b07

File tree

4 files changed

+55
-3
lines changed

4 files changed

+55
-3
lines changed

packages/x-data-grid-pro/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ export const useGridColumnHeaders = (props: UseGridColumnHeadersProps) => {
142142
pinnedPosition,
143143
indexInSection,
144144
sectionLength,
145-
rootProps.showCellVerticalBorder,
145+
rootProps.showColumnVerticalBorder,
146146
gridHasFiller,
147147
);
148148

packages/x-data-grid/src/hooks/features/columnHeaders/useGridColumnHeaders.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ export const useGridColumnHeaders = (props: UseGridColumnHeadersProps) => {
259259
pinnedPosition,
260260
indexInSection,
261261
sectionLength,
262-
rootProps.showCellVerticalBorder,
262+
rootProps.showColumnVerticalBorder,
263263
gridHasFiller,
264264
);
265265

@@ -443,7 +443,7 @@ export const useGridColumnHeaders = (props: UseGridColumnHeadersProps) => {
443443
pinnedPosition,
444444
indexInSection,
445445
visibleColumnGroupHeader.length,
446-
rootProps.showCellVerticalBorder,
446+
rootProps.showColumnVerticalBorder,
447447
gridHasFiller,
448448
)}
449449
/>
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as React from 'react';
2+
import { DataGridPro } from '@mui/x-data-grid-pro';
3+
import { randomTraderName, randomEmail } from '@mui/x-data-grid-generator';
4+
5+
const columns = [
6+
{ field: 'name', headerName: 'Name', width: 160 },
7+
{ field: 'email', headerName: 'Email', width: 200 },
8+
{ field: 'age', headerName: 'Age', type: 'number' },
9+
];
10+
11+
const rows = [
12+
{
13+
id: 1,
14+
name: randomTraderName(),
15+
email: randomEmail(),
16+
age: 25,
17+
},
18+
];
19+
20+
export default function DataGridBordered() {
21+
return (
22+
<div style={{ height: 400, width: '100%' }}>
23+
<DataGridPro rows={rows} columns={columns} showCellVerticalBorder />
24+
</div>
25+
);
26+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import * as React from 'react';
2+
import { DataGridPro } from '@mui/x-data-grid-pro';
3+
import { randomTraderName, randomEmail } from '@mui/x-data-grid-generator';
4+
5+
const columns = [
6+
{ field: 'name', headerName: 'Name', width: 160 },
7+
{ field: 'email', headerName: 'Email', width: 200 },
8+
{ field: 'age', headerName: 'Age', type: 'number' },
9+
];
10+
11+
const rows = [
12+
{
13+
id: 1,
14+
name: randomTraderName(),
15+
email: randomEmail(),
16+
age: 25,
17+
},
18+
];
19+
20+
export default function DataGridBordered() {
21+
return (
22+
<div style={{ height: 400, width: '100%' }}>
23+
<DataGridPro rows={rows} columns={columns} showColumnVerticalBorder />
24+
</div>
25+
);
26+
}

0 commit comments

Comments
 (0)