RadExpander does not resize itself correctly in a RadListView

1 Answer 116 Views
Expander
Martin
Top achievements
Rank 1
Martin asked on 21 Jun 2022, 02:12 PM

My project has a list of objects (Products) and each Product is made up of multiple Components. I display the list of Products in a RadListView, and show the Components in a RadExpander (for each element within the list).

If I add a Product with say, 4 Components to the list, then remove it, then add a Product with 2 Components the area drawn on the screen for the Components is the size that it would be if there were 4 Components. The same is true in reverse, if I add a Product with 2 Components, then remove it and add one with 4, the bottom 2 Components are cut off.

EG - Add 4 Component item - Add Truck (Door/Seat/Wheels/Windows)

Remove it from the list by clicking the X - then add a 2 Component item - Add Car (Door/Seat)

As you can see, the blue RadExpander area still has room for the extra 2 components.

Currently, I am having to clear my entire backing list out every time I Add/Remove a Product from the list to overcome this issue. Surely it should be capable of simply redrawing itself correctly?

 

I attach a Zip with a test project, currently using the latest available NuGet for Telerik.UI.for.Xamarin (2022.2.505.1), and latest Xamarin.Forms NuGet (5.0.0.2478).

Any assistance would be greatly received - thanks.

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 24 Jun 2022, 10:55 AM

Hi Martin,

Thank you for the provided project and detailed explanation of the behavior.

I have easily reproduced the issue with the expander height. The ListView recycles its cells and reuse them for other items. In this case when you remove the truck cell it is reused for Car cell and the behavior with the additional space occurs. It happens also when you add Car then remove it and add Truck. The Truck height is the same as Car. After adding several items, then scrolling the ListView the layout is updated and measured correctly. 

I have logged this behavior on your behalf. Follow the bug report at this link: https://feedback.telerik.com/xamarin/1570344-listview-cells-are-not-measured-correctly-in-custom-scenario 

For now, yes use the workaround you have found. I am afraid I could not find any different solution. 

Martin
Top achievements
Rank 1
commented on 27 Jun 2022, 08:56 AM

Hi Didi,

Thanks for getting back to me, testing it and raising the bug report on my behalf.

For now, I will continue to use the workaround and keep an eye on the bug report.

 

Thanks again!

Tags
Expander
Asked by
Martin
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or