diff --git a/src/Controls/samples/Controls.Sample.UITests/Issues/Issue20842.xaml b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue20842.xaml
new file mode 100644
index 000000000000..5a49c79641cd
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue20842.xaml
@@ -0,0 +1,69 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Controls/samples/Controls.Sample.UITests/Issues/Issue20842.xaml.cs b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue20842.xaml.cs
new file mode 100644
index 000000000000..2db023dd52de
--- /dev/null
+++ b/src/Controls/samples/Controls.Sample.UITests/Issues/Issue20842.xaml.cs
@@ -0,0 +1,62 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.Maui.Controls;
+
+namespace Maui.Controls.Sample.Issues
+{
+ internal class Person
+ {
+ public string Name { get; set; } = "";
+ public int Age { get; set; }
+ public DateTime DateOfBirth { get; set; }
+ public string Location { get; set; } = "";
+
+ public override string ToString()
+ => Name;
+ }
+
+ public class PersonDataTemplateSelector : DataTemplateSelector
+ {
+ public required DataTemplate ValidTemplate { get; set; }
+ public required DataTemplate InvalidTemplate { get; set; }
+
+ protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
+ {
+ return ((Person)item).DateOfBirth.Year >= 1980 ? ValidTemplate : InvalidTemplate;
+ }
+ }
+
+ [Issue(IssueTracker.Github, "20842", "Verify data templates in CollectionView virtualize correctly", PlatformAffected.UWP)]
+ public partial class Issue20842 : ContentPage
+ {
+ private readonly List people = new();
+
+ public Issue20842()
+ {
+ InitializeComponent();
+
+ for (int i = 0; i < 100; i++)
+ {
+ people.Add(new Person { Name = $"Kath {i}", DateOfBirth = new DateTime(1985, 11, 20), Location = "France" });
+ people.Add(new Person { Name = $"Steve {i}", DateOfBirth = new DateTime(1975, 1, 15), Location = "USA" });
+ people.Add(new Person { Name = $"Lucas {i}", DateOfBirth = new DateTime(1988, 2, 5), Location = "Germany" });
+ people.Add(new Person { Name = $"John {i}", DateOfBirth = new DateTime(1976, 2, 20), Location = "USA" });
+ people.Add(new Person { Name = $"Tariq {i}", DateOfBirth = new DateTime(1987, 1, 10), Location = "UK" });
+ people.Add(new Person { Name = $"Jane {i}", DateOfBirth = new DateTime(1982, 8, 30), Location = "USA" });
+ people.Add(new Person { Name = $"Tom {i}", DateOfBirth = new DateTime(1977, 3, 10), Location = "UK" });
+ }
+
+ PersonList.ItemsSource = people;
+ }
+
+ private void ScrollToTopButton_Clicked(object sender, EventArgs e)
+ {
+ PersonList.ScrollTo(0, animate: false);
+ }
+
+ private void ScrollToBottomButton_Clicked(object sender, EventArgs e)
+ {
+ PersonList.ScrollTo(people.Count - 1, animate: false);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Controls/tests/UITests/Tests/Issues/Issue20842.cs b/src/Controls/tests/UITests/Tests/Issues/Issue20842.cs
new file mode 100644
index 000000000000..8ee4897df5c4
--- /dev/null
+++ b/src/Controls/tests/UITests/Tests/Issues/Issue20842.cs
@@ -0,0 +1,36 @@
+using NUnit.Framework;
+using UITest.Appium;
+using UITest.Core;
+
+namespace Microsoft.Maui.AppiumTests.Issues
+{
+ public class Issue20842 : _IssuesUITest
+ {
+ const string scrollUpButton = "ScrollUpButton";
+ const string scrollDownButton = "ScrollDownButton";
+
+ public Issue20842(TestDevice device) : base(device)
+ {
+ }
+
+ public override string Issue => "Verify data templates in CollectionView virtualize correctly";
+
+ [Test]
+ public async Task VerifyCollectionViewItemsAfterScrolling()
+ {
+ this.IgnoreIfPlatforms([TestDevice.Android, TestDevice.iOS, TestDevice.Mac]);
+
+ App.WaitForElement(scrollUpButton);
+
+ App.Click(scrollDownButton);
+ await Task.Delay(200);
+ App.Click(scrollUpButton);
+ await Task.Delay(200);
+ App.Click(scrollDownButton);
+ await Task.Delay(500);
+
+ VerifyScreenshot();
+ }
+ }
+}
+
diff --git a/src/Controls/tests/UITests/snapshots/windows/VerifyCollectionViewItemsAfterScrolling.png b/src/Controls/tests/UITests/snapshots/windows/VerifyCollectionViewItemsAfterScrolling.png
new file mode 100644
index 000000000000..3d0655289de1
Binary files /dev/null and b/src/Controls/tests/UITests/snapshots/windows/VerifyCollectionViewItemsAfterScrolling.png differ