Data Grid rounded corners? #17766
Replies: 2 comments
-
You can easily place any visual in a border, give it rounded corners and have it clip its content. Another way, Add CornerRadius to Image (for example): `
} |
Beta Was this translation helpful? Give feedback.
-
You mean like this? Which 'just works' was it not that Which I fixed by doing this: <ControlTheme
x:Key="MyDataGrid"
BasedOn="{StaticResource {x:Type DataGrid}}"
TargetType="DataGrid">
<Style Selector="^ /template/ Border#DataGridBorder">
<Setter Property="ClipToBounds" Value="True" />
</Style>
</ControlTheme>
<DataGrid
CornerRadius="50"
Theme={StaticResource MyDataGrid}
ClipToBounds="True" <!-- but this one is not bound to the border, so not working by default -->
/> It might be an oversight in the default DataGrid ControlTheme -- i.e. the default ControlTheme for ListBox does bind the ClipToBounds to its Border. Other easier workaround, just surround the DataGrid with another |
Beta Was this translation helpful? Give feedback.
-
I'm wondering if anyone has done so that only the outer corners of the data grid are rounder when using corner radius
Beta Was this translation helpful? Give feedback.
All reactions