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

Data bind Report Property of WPF ReportViewer

1 Answer 115 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Dave
Top achievements
Rank 1
Dave asked on 03 Jun 2010, 08:31 PM
I'm using the Model-View-ViewModel pattern in a WPF project and I have the new WPF ReportViewer control in a UserControl. I want to databind the Report property to a property of the underlying VIewModel:

 

 

 

<telerik:ReportViewer Report="{Binding Report}"

 

 

 

Grid.Column="1"/>

 


However, the report does not display - it just says "No Report" in the ReportViewer. I fired up Snoop and noticed that the DataContext does not appear to inherit from the UserControl. It's set to Telerik.ReportViewer.ReportViewerModel. Therefore, my binding is presumably looking for a Report property on this object, not the DataContext of the UserControl that hosts the ReportViewer. Is this possible? When the Report property gets set in my VM I'm raising a property changed event to update the UI.

Thanks,
Dave

1 Answer, 1 is accepted

Sort by
0
Steve
Telerik team
answered on 04 Jun 2010, 03:56 PM
Hi Dave,

The binding expression you've posted is not correct. Please review our demo WPF application that comes with the Telerik Reporting installation for runnable demo, as well as this forum thread for a similar problem explanation.

Greetings,
Steve
the Telerik team

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 Public Issue Tracking system and vote to affect the priority of the items.
Tags
General Discussions
Asked by
Dave
Top achievements
Rank 1
Answers by
Steve
Telerik team
Share this question
or