How can I set the color of a selected row in DataGrid

后端 未结 8 1581

The default background color of a selected row in DataGrid is so dark that I can\'t read it. Is there anyway of overriding it?

Tried this



        
8条回答
  •  执念已碎
    2020-11-28 20:29

    Some of the reason which I experienced the row selected event not working

    1. Style is set up for DataGridCell
    2. Using Templated columns
    3. Trigger is set up at the DataGridRow

    This is what helped me. Setting the Style for DataGridCell

    
    

    And since I was using a template column with a label inside, I bound the Foreground property to the container Foreground using RelativeSource binding:

    
      
        
          
      
    
    

提交回复
热议问题