Ticket T218201
Visible to All Users

How to implement cell animation in the grid and make sure that there are no virtualization issues

created 10 years ago

[DevExpress Support Team: CLONED FROM KA18635: How to avoid problems with the DXGrid virtualization mechanism]

Hi Support,
Thank you for your sample. Is there a way to change background color of only one cell (not entire row), using this approach (attached properties)? Like in this questionhttps://www.devexpress.com/Support/Center/Question/Details/Q451047, but without virtualization problems.

Comments (1)
AA AA
Anastasia Afanasieva 10 years ago

    I have problems with advice from https://www.devexpress.com/Support/Center/Question/Details/Q451047 . Exactly as described in https://www.devexpress.com/Support/Center/Question/Details/KA18635 . But approach suggested in KA18635 (attaching property to the RowState object) didn't work for me the way i intended -- it affects the whole row and not just modified cell.
    Can my goal be achieved using this approach?
    Thank you.

    Answers approved by DevExpress Support

    created 10 years ago

    Hi Anastasia,

    Yes, it's possible to avoid virtualization issues in your scenario. I have prepared a sample based on our project from Q587620 demonstrating two different approaches. Please take a moment to review it.

      Comments (2)
      AA AA
      Anastasia Afanasieva 10 years ago

        Thank you! I achieved my goal. But i faced a strange behavior when i used EditSettings for a column. The intended behavior (highlighting changed cells) was not working on a column with EditSettings. I attached a modified sample to show my problem. There column B has EditSettings and is not highlighting cells (except for the first one), but columns A and C are working just fine.

        DevExpress Support Team 10 years ago

          I have researched your sample, and it appears that this issue is not directly related to EditSettings. It occurs because you don't re-create the CellsChanged/CellsOutRange collection in the CellValueChanged event handler, but add a new item to an existing collection. Since the property value is not changed, a binding is not triggered immediately. As a quick fix, you can add an additional binding to the Count property:

          XAML
          <Setter Property="Foreground"> <Setter.Value> <MultiBinding Converter="{StaticResource colorConverter}"> <Binding Path="(local:CellsHightlightHelper.CellsOutRange)" RelativeSource="{RelativeSource AncestorType=dxg:TableView}"/> <Binding Path="RowData.Row"/> <Binding Path="Column"/> <Binding Path="Value"/> <Binding Path="(local:CellsHightlightHelper.CellsOutRange).Count" RelativeSource="{RelativeSource AncestorType=dxg:TableView}"/> </MultiBinding> </Setter.Value> </Setter> <Setter Property="TextElement.FontWeight"> <Setter.Value> <MultiBinding Converter="{StaticResource fontConverter}"> <Binding Path="(local:CellsHightlightHelper.CellsChanged)" RelativeSource="{RelativeSource AncestorType=dxg:TableView}"/> <Binding Path="RowData.Row"/> <Binding Path="Column"/> <Binding Path="Value"/> <Binding Path="(local:CellsHightlightHelper.CellsChanged).Count" RelativeSource="{RelativeSource AncestorType=dxg:TableView}"/> </MultiBinding> </Setter.Value> </Setter>

          In this case, multibinding will be triggered on each modification of your collection.

          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.