Field appears multiple times in the designer

Hi,

we have the problem, that a field appears multiple times.
We have the following structure for the fields in .net:

public class LLFormParent
{
public LLFormChild1 SingleChild { get; set; }
}

public class LLFormChild1
{
public LLFormChild2 SingleSubChild { get; set; }
public List<LLFormChild2> SubChildren { get; set; }
}

public class LLFormChild2
{
public string TestProperty { get; set; }
}

When we use the LLFormParent as datasource

combit.Reporting.ListLabel LL = new combit.Reporting.ListLabel();
LL.DataSource = new List<LLFormParent>();

The following fields are generated:
image

As you can see the “SingleChild” Field appears multiple times, but we only need it to appear once. How can we achieve that?

Things are more complicated than they look here :slight_smile:. First of all, the field tree does not show the relational structure of the data, but rather has a node for each table that is added in the data structure. We just recently had a post on StackOverflow tackling that topic.

Now to your structure - the actual table structure looks like this:

image

As the SubChildren are a List<LLFormChild2> they need to be added as actual table to the structure - and so do all its parents (SingleChild in this case). As soon as you remove the SubChildren from the structure you’ll get the flat view you’re after. But if the view is not actually flat, the field tree behaves as designed and shows a node for each table in the data structure.

I figure this sounds quite complicated (and is, indeed, your structure is non trivial at second sight) - feel free to follow up with any questions you might have.