Setting Grid Value from existing PropertyType - Programatically Move Prop and Value
Hi all I have a situation where I want to move a grid property type and it's value from one doc type to another programatically.
So I'm doing something like so:
foreach (var group in contentPageDocType.PropertyGroups.ToArray())
{
foreach (var prop in group.PropertyTypes.Where(pt => myPage.HasProperty(pt.Alias) && myPage.GetValue(pt.Alias) != null))
{
//Store the composed property type values so we can manually add them back in after removing the composition
composedPropertyValues.Add(new PropertyValueGroupStore { PropertyType = prop as PropertyType, PropertyValue = loyaltySummaryPage.GetValue(prop.Alias), GroupName = group.Name });
}
}
And then iterating over the built up properties, groupings etc and transferring them over to my other node of a given doc type and calling
Content.SetValue(propertyAlias, value);
This is creating the grid datatype but almost appears to be escaping the JSON and that json then appears in each grid row with an error in the admin section.
I originally tried property.DeepClone() unsucessfully.
Setting Grid Value from existing PropertyType - Programatically Move Prop and Value
Hi all I have a situation where I want to move a grid property type and it's value from one doc type to another programatically.
So I'm doing something like so:
And then iterating over the built up properties, groupings etc and transferring them over to my other node of a given doc type and calling
This is creating the grid datatype but almost appears to be escaping the JSON and that json then appears in each grid row with an error in the admin section.
I originally tried property.DeepClone() unsucessfully.
Any advice would be most appreciated!!
is working on a reply...