"Pre-defined" FDataTableRowHandle or how to expose a dropdown of a datatable row names

Hi !

Let’s say I have a struct A, inheriting from FDataTableRowBase. In another struct B (inheriting too from FDataTableRowBase) I want to reference rows in the datatable based on A.
So In my project I have the datatables DataA and DataB, based respectively on A and B, and B reference a row in DataA.
The simplest way to do this, is to put a FDataTableRowHandle UPROPERTY() in B. But doing so I need to specify the datatable in each new row of DataB…
I there a way to have the same dropdown I have with the rows name from a datatable, without having to specify each time the datatable ?
Not sure I’m entirely clear…

For a less abstract example, in my project I basically have two datatable, one with “enemies” and another with “enemy parties” in which I would like to be able to select directly from the enemy table. Knowing that the enemy datatable is already accessible globally through a singleton class.

Also would like to know the answer to this. Have tried extending FDataTableRowHandle and initializing the DataTable in the constructor, which works. However, in doing this, “RowName” no longer becomes a drop down and is simply and FName field.

Took me some digging but I figured out the solution to this. You can achieve this effect by creating a Customization Layout for your struct (IPropertyTYpeCustomization) and then registering it via FPropertyEditorModule::RegisterCustomPropertyTypeLayout.

In my case, I loaded the datatable asset in my customization layout class, bypassing the need to have it as a uproperty in my struct.

The doc pages linked below will give you some more info on what to do, but I recommend looking at DataTableCustomization.h for an example on this particular problem.

Thanks !
I thought about some editor extension too, but couldn’t figure it out. I’ll look into that!

Can we do this without c++ ?

I want my variable to be only the row handle name of a predefined datatable and not having to pick a datable and select a raw handle. Something like exposing the datatable row list itself as a variable

There’s already a built in property editor for FDataTableRowHandle called FDataTableCustomizationLayout, so you shouldn’t need to build your own. By default it already supports the “RowType” meta tag, which allows you to narrow the asset selector to data tables of a particular class derived from FTableRowBase. I’m not going to go into the details, but it was fairly easy for me to modify FDataTableCustomizationLayout and add another meta tag that allows you to specify an asset name and have it auto-select the asset for you. Much simpler than making an entire property editor from scratch.