Animation on DataGridRow jumps to wrong row when scrolling
-
I have a DataGrid where we display an animation on DataGridRows when a property in the ItemSource is set. If the height of the DataGrid is enough low to display the VerticalScrollBar, I can scroll up and down and see the animations jump to the wrong rows. I have made code snippet that reproduce the issue: * The code shuld be "copy-paste". * The DataGrid displays a list of Persons. * If a person's
HasBirthday = true
the corresponding DataGridRow displays the animation. * The first item in the list hasHasBirthday = true
. To reproduce 1) Notice the first row has the animation running already. 2) Click the second row in the Grid. 3) Scroll down. 3) Some other row should now also have the animation on it. Scrolling up and down a couple of times should also diplay the issue. * Any explanation why this happens? * Any suggestions how to fix this? /BR Steffe XAML<Setter Property="Foreground" Value="Blue" /> <Setter Property="Background" Value="LightGray" /> <Setter Property="MinHeight" Value="26" /> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="Gray" /> </Trigger> </Style.Triggers> <Style.Triggers> <MultiData</x-turndown>
-
I have a DataGrid where we display an animation on DataGridRows when a property in the ItemSource is set. If the height of the DataGrid is enough low to display the VerticalScrollBar, I can scroll up and down and see the animations jump to the wrong rows. I have made code snippet that reproduce the issue: * The code shuld be "copy-paste". * The DataGrid displays a list of Persons. * If a person's
HasBirthday = true
the corresponding DataGridRow displays the animation. * The first item in the list hasHasBirthday = true
. To reproduce 1) Notice the first row has the animation running already. 2) Click the second row in the Grid. 3) Scroll down. 3) Some other row should now also have the animation on it. Scrolling up and down a couple of times should also diplay the issue. * Any explanation why this happens? * Any suggestions how to fix this? /BR Steffe XAML<Setter Property="Foreground" Value="Blue" /> <Setter Property="Background" Value="LightGray" /> <Setter Property="MinHeight" Value="26" /> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="Gray" /> </Trigger> </Style.Triggers> <Style.Triggers> <MultiData</x-turndown>
I would just change the color of the row. Cost versus benefit.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I
-
I would just change the color of the row. Cost versus benefit.
"Before entering on an understanding, I have meditated for a long time, and have foreseen what might happen. It is not genius which reveals to me suddenly, secretly, what I have to say or to do in a circumstance unexpected by other people; it is reflection, it is meditation." - Napoleon I