I've tried setting border style as suggested here Disable DataGrid current cell border in FullRow selection mode, but it doesn't do the thing fully. Is disables cell border selection when you select using a mouse, but there is still a dashed cell border when making selection using keyboard. Any suggestions?
.net – How to suppress DataGrid cell selection border
netwpfxaml
Related Topic
- C# – How to create an Excel (.XLS and .XLSX) file in C# without installing Microsoft Office
- C# – How to get a consistent byte representation of strings in C# without manually specifying an encoding
- Wpf – Disable DataGrid current cell border in FullRow selection mode
- C# – wpf datagrid customization (border, cell corners, etc.)
Best Answer
the dashed box you see is the cell's
FocusedVisualStyle
you need to override it so that it is blank.
2 options here (one of them has to be the right one but as I didn't have time to try, I don't know which)
this means you have to set it through the
CellStyle
property:or if you want to comply with MS's templating guidelines:
(this way, you can see how it is done)
ElementStyle
or theEditingElementStyle
this is more of a hasle there, because the
ElementStyle
andEditingElementStyle
are defined on the Column, wich means you have to edit each column'sElementStyle
andEditingElementStyle
.but basically, this is the same thing: you set up the FocusVisualStyle to null or the style defined above through the
ElementStyle
and/orEditingElementStyle
on each Column