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
290
XamDataGrid animation (row by row display)
posted

I am currently using the XamDataGrid to display the data from a DataTable. How can I add an animation to the XamDataGrid in order to display the content of the grid row by row, when the grid is loaded?

  • 34810
    Offline posted

    Hello George,

    Thank you for your post.

    I am not entirely sure how you would be able to place a pure animation on the XamDataGrid to display the content of a grid, row by row, but I do have a method to use for a sort of "simulated" animation.

    First, I would recommend adding a column to your DataTable which is bound to your grid of type "double." At the start, set all of these values to 0. If you write a Style for DataRecordPresenter in your XAML, you can bind the Opacity property of the DataRecordPresenter to this property by using the following binding = "{Binding DataItem.OpacityPropertyName}". When the grid loads, I would recommend using a timer and hooking into it's Tick event. In this event, you can obtain the rows one by one, and increment the bound opacity value up to a value of 1 so that the content of the record will be fully visible.

    As an alternative, you could have two collections, with one holding all of your data and the other being empty. If you bind the XamDataGrid to the empty collection at the start, you can intermittently add records to that collection from the full one and they will show up in the grid.

    I have attached a sample project to demonstrate the opacity binding. I hope this helps you.

    Please let me know if you have any other questions or concerns on this matter.

    Sincerely,
    Andrew
    Associate Developer
    Infragistics Inc.
    www.infragistics.com/support

    XDGDataTableRowAnimationCase.zip