Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
860
How to change the row color when unselect the row
posted

In the xamDataGrid, when I select a row, the color of the row change to show it's selected, I click or ctrl+click to unselect the row, but the color of the row doesn't change, still looks like it's selected, only when I click or ctrl+click other row, the unselected row will change color.

Is there a way that when unselect a row to make it's color change to the unselected color?

I have tried the following style but not working:

<Style TargetType="{x:Type igDP:DataRecordCellArea}">

<Style.Triggers>

<DataTrigger Binding="{Binding Path=IsSelected}" Value="False">

<Setter Property="BackgroundActive" Value="Transparent"/>

<Setter Property="BorderActiveBrush" Value="Transparent"/>

</DataTrigger>

</Style.Triggers>

</Style>

Thanks.

Parents
  • 22015
    Verified Answer
    posted

    Hello yingwu,

     

    Thank you for your post!

     

    I have been looking into it. What I can suggest is using Trigger instead of DataTrigger for the IsSelected property. I have created a small sample application for you to show you this behavior.

     

    Please find the attached sample application and feel free to let me know if you have any further questions on this matter.

    DataGrid_SelectionColor.zip
Reply Children
No Data