Can't get valid IPropertyHandle for Child Uproperty

I have a Details Customization that uses a Custom Slated widget to render inline a selected item in one of it’s arrays.
The Slate widget takes the DetailLayout as a parameter.
I’m able to get the property handle for the selected item in the array however when I try to use GetChildHandle on the handle it fails to return the property on the selected object.

Stepping through the code it seems there are no child nodes thous it ends up returning null.

Here Code I’m using


  TSharedPtr ObjectiveHandle = DetailLayout.GetProperty(GET_MEMBER_NAME_CHECKED(UQuest, Objectives))->AsArray();
  if(!ObjectiveHandle.IsValid())
  {
    return;
  }
  AmountHandle = ObjectiveHandle->GetElement(ObjectiveIndex);
  if(!AmountHandle.IsValid() || !AmountHandle->IsValidHandle())
  {
    return;
  }
  //now we can grab the amount handle.
  AmountHandle = AmountHandle->GetChildHandle(TEXT("Amount"));
    

When i just use the Objective Object I get and generate it’s widget instead I get like an instance browser fro it.

I’m not sure if this is the way to go or could I possible use the Normal UObject based Objective Class to get a property handle to the amount UProperty I haven’t been find code that does this.

I’m not sure if this is the same problem, but sometimes IPropertyHandle::GetChildHandle does not work for me either. There are two solutions which I have come across:

// 1. Use DetailLayout instead of the original property handle
DetailLayout.GetProperty(FName("PropertyName"), UBaseClass::StaticClass());

// 2. Iterate through properties instead of name lookup
uint32 NumElements;
ItemHandle->GetNumChildren(NumElements);
for (uint32 ElemIndex = 0; ElemIndex < NumElements; ElemIndex++)
{
auto ElemHandle = ItemHandle->GetChildHandle(ElemIndex);
if (ElemHandle->GetProperty()->GetFName() == GET_MEMBER_NAME_CHECKED(UBaseClass, PropertyName))
	{ /* do stuff */ }
}

Source for solution #1