Ticket Q587620
Visible to All Users

DataGrid entry highlight on change

created 11 years ago

I have built a DataGrid and have my values displaying. How can I easily have a cell highlight and fade to normal after a value changes?

Show previous comments (6)

    Hello Ivan,
    Thank you for the feedback.
    Bryce

    DevExpress Support Team 11 years ago

      Hello Bryce,

      In the GridControl implementation, the NotifyOnTargetUpdated property isn't specified for cell bindings (Flash GridControl Cell on value changed?). Therefore, to animate a newly updated cell in a read-only GridControl, I suggest you store information about modified cells and based on this info, highlight cells.The easiest way to store information in the GridControl in ReadOnly mode is to create an additional property at the data object level (as Vito suggested in How to make every cell flashes when the displayed value changes). I have created a sample project that illustrates this approach in action.

      Thanks,
      Michael

        Hello Support/Michael,
        While the example code works, it is very UGLY and highly error prone.  I have so many tables with so many fields, that this is NOT a workable solution.  I must say I am shocked that the standard DataGrid supports this feature and the DxGrid does not.  Clearly from the pointers you provided, I am not the only customer who has asked for this feature.  What other alternatives can you suggest?
        Bryce

        Answers approved by DevExpress Support

        created 11 years ago (modified 10 years ago)

        Hi Bryce,

        I would like to clarify one point. The standard DataGrid does not support this functionality, and the approach with Binding.TargetUpdated has many side effects. For example:

        1. When you scroll rows, cells are highlighted, and data source values are not changed.
        2. When you change data and start to scroll rows, animation is restarted.
        3. If you select a row with animation, it's cancelled.
        4. If you edit data in a grid, the animation is not raised, etc. See the attached screencast.

        If you would like to implement the exact same behavior in our GridControl, it's not a problem. The question is whether users will like it, because the animation on Binding.TargetUpdated has nothing to do with "animation for modified cells". The only approach to achieve this goal is to implement an additional field that will signal whether the field was modified as Michael has shown.
        In any case, if you wish to implement the exact same appearance as the Binding.TargetUpdated, drop me a line. I will prepare a sample for you.

        Updated

        An easier solution would be to use an approach similar to the one demonstrated in the A general approach to highlighting specific grid cells example. Please check the attached sample project to learn more.

          Show previous comments (13)

            The attached example itself doesnt work properly.  If you run it up and then scroll quickly you can clearly see animations occurring even in cells which have not been updated (ie. showing their orignal data).  Its slightly better than using TargetUpdated where numerous unedited cells flash upon scrolling, but its still far from ideal.
            Its astonishing that there is no easy, or even guaranteed, way to get a cell to flash when its data changed (and not when it hasnt) - something that was trivial in Winforms.

            DevExpress Support Team 10 years ago

              Hi James,
              We need some additional time to research this and find the most appropriate solution. Please stay tuned.

              DevExpress Support Team 10 years ago

                Hi James,
                I have modified the sample so that it now doesn't show animation for non-modified cells. Please find it in the attached archive.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.