diff --git a/src/Framework/Framework/Controls/HierarchyRepeater.cs b/src/Framework/Framework/Controls/HierarchyRepeater.cs index 39db3f82d5..520bad1a04 100644 --- a/src/Framework/Framework/Controls/HierarchyRepeater.cs +++ b/src/Framework/Framework/Controls/HierarchyRepeater.cs @@ -258,6 +258,7 @@ private void SetChildren(IDotvvmRequestContext context, bool renderClientTemplat Internal.PathFragmentProperty, $"{GetPathFragmentExpression()}{parentSegment}/[{index}]"); placeholder.SetValue(Internal.UniqueIDProperty, "item"); + placeholder.SetDataContextTypeFromDataSource(GetDataSourceBinding()); // DataContext type has to be duplicated on the placeholder, because BindingHelper.FindDataContextTarget (in v4.1) dataItem.Children.Add(placeholder); ItemTemplate.BuildContent(context, placeholder); diff --git a/src/Tests/ControlTests/testoutputs/HierarchyRepeaterTests.CommandInMarkupControl-server.html b/src/Tests/ControlTests/testoutputs/HierarchyRepeaterTests.CommandInMarkupControl-server.html index 290379db3d..c37b3bba11 100644 --- a/src/Tests/ControlTests/testoutputs/HierarchyRepeaterTests.CommandInMarkupControl-server.html +++ b/src/Tests/ControlTests/testoutputs/HierarchyRepeaterTests.CommandInMarkupControl-server.html @@ -4,19 +4,19 @@
-
+
-
+
-
+
-
+
-
+