Hi there,
I have an existing view with an view model as the data context, I am adding a report (Telerik Reporting 2013Q1) to the page, I use one of the public properties of the viewmodel as the data source (it's a list of object), but the report is empty seems like there is no data, here is some code:
1. the view
2. the property view model
3. the initialize in view mode:
And finally the report is attached. In debug mode, I check the view model (MyItems) does have data.
thanks.
--ricky
I have an existing view with an view model as the data context, I am adding a report (Telerik Reporting 2013Q1) to the page, I use one of the public properties of the viewmodel as the data source (it's a list of object), but the report is empty seems like there is no data, here is some code:
1. the view
<
tr:ReportViewer
Name
=
"ReportViewerStrats"
ReportSource
=
"{Binding DataContext.ReportSource, ElementName=StratsView}"
/>
2. the property view model
private List<
MyItem
> _myItems;
public List<
MyItem
> MyItems
{
get { return _myItems; }
set
{
_myItems = value;
base.OnPropertyChanged("MyItems");
}
}
3. the initialize in view mode:
MyItems = GetItems(); //Get from database
ReportSource = new MyReport();
And finally the report is attached. In debug mode, I check the view model (MyItems) does have data.
thanks.
--ricky