This is a migrated thread and some comments may be shown as answers.

Binding a collection containing a nested list

1 Answer 289 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bastien
Top achievements
Rank 1
Bastien asked on 08 Aug 2017, 03:55 PM

I'm currently encountering an issue while trying to bind a collection to a table. I have a collection of a generic structure containing a list of fields. I want to bind the collection to a table and be able to show each field in the appropriate column. Unfortunately, it doesn't seem to work...

Is there a way to do that? It seems that most of the time, the advice is: set the report data source to the collection of objects. But this is not an option here, since I have other data to show which needs to be part of the data source.

Also, is there a way to inspect the Fields object when debugging?

Best Regards,

Bastian

1 Answer, 1 is accepted

Sort by
0
Accepted
Ivan Hristov
Telerik team
answered on 11 Aug 2017, 07:27 AM
Hello Bastien,

When you need to bind a data item to a collection of business object, usually in a master-details scenario, we recommend to use Bindings, configuring the data item's DataSource property to use the collection. This is done using the expression "=ReportItem.DataObject", as explained here.

You can take a look at this KB article that explains the same concept, but for SubReport. Additionally you can check the article How to use the ReportItem.DataObject property in expressions for more details.

Hope it helps.

Regards,
Ivan Hristov
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Bastien
Top achievements
Rank 1
Answers by
Ivan Hristov
Telerik team
Share this question
or