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

Reporting and Tab Control

1 Answer 100 Views
TabControl
This is a migrated thread and some comments may be shown as answers.
Jonathan
Top achievements
Rank 1
Jonathan asked on 30 Dec 2014, 03:21 PM
I am using PRISM/Unity and Telerik's WPF controls to create a business solution for generating and viewing reports.  I have a module that is dedicated to simply displaying the generated reports.  My View for the reports originally was implmented as a <Window> </Window> with a single <ReportViewer> with the report data source bound to a backing field in the ViewModel for the Window.  I am now attempting to convert to a tabbed control structure to allow the users to view more than one report at a time.  I VM defined as a static resource in the window and the codebehind of the window exposes a single method that allows the addition of reports to its tab control (given that it's entirely a piece of display functionality, I don't think it violates the MVVM principles.

Back to the question:  during the add process, I generate an instance report source and add it to an ObserableCollection<InstanceReportSource> that is the ItemSource bound to the "ItemSource" property of the tab control and then show the window that contains the Tab Control. During the AddReport method, I perform a RaisePropertyChanged("ReportSourceCollection") to notify the Tab control that it needs to add a new tab containing a report.  The issue I'm running into is that when the window opens, no report is displayed.  Through my debugging, I've found that the addition of items, and property changed events are properly raised.

Has anyone else had an issue with Report Viewer in the Tab control?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 02 Jan 2015, 11:36 AM
Hello Jonathan,

I have attached a very simple project demonstrating a bound tab control. Upon a button click, an item is inserted in the tabs collection of the view model and the tab control immediately creates a new tab for the new item. Do give it a try and see how it goes.

I am unsure how you have implemented this in your actual application, but I hope that you will be able to find the differences with the project I sent and adopt the same approach. If you need further assistance with this, please modify the project to mimic your set up and to reproduce the behavior so that we can investigate it.

Regards,
Petar Marchev
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
TabControl
Asked by
Jonathan
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or