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

Getting values from parent table

1 Answer 143 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 02 Sep 2009, 08:42 PM
Hi I am stuck on a problem. I have 2 tables which are nested on a single report. Both datasources are being set in their needdatasource method respectively.

My problem lies in retrieving a value from the parent table which will populate the child tables based on whatever values which are retrieved from the parent. I just need to retrieve one variable from the parent table once it is populated so that I can populate the child table accordingly.

Basically, I want a master-details / master-child relationship

Thanks

1 Answer, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 04 Sep 2009, 04:57 PM
Hello Bill,

As you know the Table item is a data item and just like the Report it has its own data source. This data source defines the content of item (the Table in this case) while the item itself is bound to the data of its parent data item.

In the following code snipped the DataObject points to the current row of the parent data source that for your case should be the outer table:

void table1_NeedDataSource(object sender, EventArgs e) 
    var processingTable = sender as Telerik.Reporting.Processing.Table; 
    var category = processingTable.DataObject["ProductCategory"]; 
 
    processingTable.DataSource = GetInnerTableDataSource(category); 

Please note that the processing items are used to get the current DataObject and to set the data source. For more information please see Understanding Events.

 
Sincerely yours,
Svetoslav
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
General Discussions
Asked by
Bill
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Share this question
or