Won't Fix
Last Updated: 21 May 2024 10:47 by ADMIN
Luis Henrique
Created on: 08 Apr 2024 09:17
Category: GridView
Type: Bug Report
1
GridView: The UI is not updated when an item is replaced in the bound ListCollectionView

The UI is not updated when an item is replaced in the bound ListCollectionView. 

Workaround: Remove the item and add a new one.

1 comment
ADMIN
Vladimir Stoyanov
Posted on: 21 May 2024 10:46

The described issue is only reproducible in .NET6+ and comes from the fact that the business object that populates the RadGridView ItemsSource and the ListCollectionView overrides the Equals method. When replacing an item, the ListCollectionView in .NET6 checks whether the old item and the new item are equal through the Equals method. This can be observed in in its source code. If the replaced item is equal to the old item, the ListCollectionView raises just one CollectionChanged event (Move) instead of 2 (Remove/Add).

To summarize, if overriding the Equals method of a business object, make sure that the Equals method returns false when replacing an item in the bound collection so that the correct CollectionChanged events can be raised by the ListCollectionView. 

Regards,
Vladimir Stoyanov
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.