Disable DataGrid current cell border in FullRow selection mode

后端 未结 7 951
走了就别回头了
走了就别回头了 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 00:57

    If you want to show a border only when the cell is editable and selected you can override the DataGridCell template and add a multitrigger for when the cell IsSelected and not IsReadOnly. Then no border will be shown for cells if you set IsReadOnly = true for the column or DataGrid

    
        
            
            
    
        
        
            
                
                    
                    
                
                
            
        
    
    

    Use the template in a style

    
    

    And use the style

    
        ...
    
    

提交回复
热议问题