Set the Background of a DataGridRow based on the content of a cell

前端 未结 1 919
野的像风
野的像风 2021-01-12 15:54

Is there a way, using XAML, to dynamically set the background of a row based on the content of one of it\'s cells?

Thanks,

Phil

1条回答
  •  生来不讨喜
    2021-01-12 16:35

    You can define a style for a row and change the color using DataTrigger. Something like this:

    
        
            
        
    
    

    Here BooleanPropertyOnObjectBoundToRow is a boolean property on your data object one the cells is bound to.

    0 讨论(0)
提交回复
热议问题