WPF DataGrid selected row style

后端 未结 3 1999
闹比i
闹比i 2020-12-14 05:37

I\'m stuck with one very stupid problem - need to style selected row in WPF DataGrid.

I want to show a rectangle with blue border instead of just filling entire row

3条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-14 06:23

    Use CellStyle and RowStyle on DataGrid. DataGridCell and DataGridRow both have IsSelected property that can be used in a Trigger to find out if they are selected.

    Something like following should do the trick:

    
        
    
    
        
    
    

    Just play around until you get it right.

提交回复
热议问题