Disable DataGrid current cell border in FullRow selection mode

后端 未结 7 904
走了就别回头了
走了就别回头了 2020-12-24 00:19

I am using a DataGrid in row selection mode (i.e., SelectionUnit=\"FullRow\"). I simply want to remove the border that is being placed around the current cell w

7条回答
  •  有刺的猬
    2020-12-24 01:12

    Saw another answer here that was close, but it didn't get rid of the Focus rectangle. Here's how to obliterate all of the borders.

    
        
    
    

    Also, since technically those cells still do get focus (you just don't see it), to make the tab key advance to the next row instead of the next cell, I define a cell style based on the above but which also adds the following...

    
        
    
    

    ...then I apply that to all but the first column definition. That way the tab key advances to the next row, not the next cell.

    Back to the borders however. If you want to hide them but still want them to be part of the layout for spacing-reasons, change the above to this...

    
        
    
    

    Enjoy! :)

提交回复
热议问题