質問

I am working on a wpf application and using report viewer control in windows form host. Everything was working fine, until I use Metro Mahapps to improve the GUI of my application. Report viewer control stops rendering. The code is

  <WindowsFormsHost x:Name="WindowsFormHostCustomer" Grid.Row="3">
          <winForms:ReportViewer  x:Name="rptViewerCustomers">

         </winForms:ReportViewer>
    </WindowsFormsHost>

Anybody else have this bug and any proposed solution.

役に立ちましたか?

解決 2

To achieve this functionality, we just need to add this code in the xaml

    <i:Interaction.Behaviors>
        <behaviours:BorderlessWindowBehavior ResizeWithGrip="True" AllowsTransparency="False" />
    </i:Interaction.Behaviors>

If we have intentions to use report viewer control in user controls, we need to add this piece of code in the window which is hosting the user control.

他のヒント

The window in Mahapps(called MetroWindow) will set AllowsTransparency(via BorderlessWindowBehavior, see metrowindow.xaml) to true which will cause issue in rendering, such as WebBrowser, I am not quite clear why this cause this issue, probably ReportView doesn't support transparent...(you can ask google), if you want reportview work, you must set this property to false or use regular window.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top