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

Accessing Table's data source on item databound

1 Answer 308 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Carl
Top achievements
Rank 1
Carl asked on 09 Apr 2010, 11:48 AM
Hello,

I have a report with just one table. Rather than setting the DataSource of the report itself I set the datasource of the table. I want to be able to access the current data item and calculate a value in a text box within the table based on that data.

In doing similar work on the detail ItemDataBound method I am able to access the data using:

 DetailSection section = (DetailSection)sender;
 MyObject obj = section.DataObject.RawData as MyObject;

However when I do the same on the table's ItemDataBound method:

Table table = (Table)sender;
MyObject obj = table.DataObject.RawData as MyObject;

... the obj being returned is not null but a 'new' instance of a MyObject.

Please could you let me know how I can get around this problem?

Thanks, Carl

1 Answer, 1 is accepted

Sort by
0
Massimiliano Bassili
Top achievements
Rank 1
answered on 14 Apr 2010, 03:10 PM
I guess this forum should answer your question: http://www.telerik.com/community/forums/reporting/telerik-reporting/can-a-table-use-the-reports-fields.aspx

Cheers
Tags
General Discussions
Asked by
Carl
Top achievements
Rank 1
Answers by
Massimiliano Bassili
Top achievements
Rank 1
Share this question
or