Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Animation on DataGridRow jumps to wrong row when scrolling

Animation on DataGridRow jumps to wrong row when scrolling

Scheduled Pinned Locked Moved WPF
helpcssdatabasewpftutorial
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mc_Topaz
    wrote on last edited by
    #1

    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 has HasBirthday = 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>
    
    L 1 Reply Last reply
    0
    • M Mc_Topaz

      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 has HasBirthday = 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>
      
      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      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

      M 1 Reply Last reply
      0
      • L Lost User

        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

        M Offline
        M Offline
        Mc_Topaz
        wrote on last edited by
        #3

        Hi! Sorry I don't understand. Can you please explain what you mean?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups