How to disable Search in Reporting?

1 Answer 198 Views
Report Viewer - WPF Styling
Joshua
Top achievements
Rank 1
Joshua asked on 18 Apr 2022, 03:14 PM

Good morning,

Every time I hit this button, I get a NullReferenceException:

As I don't actually need to have search capability, I'd like to just remove this button. Is there a way to do this and/or intercept the handler so I can suppress the action and/or is there a simple fix?

My XAML declaration is just:

Thanks!

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 21 Apr 2022, 04:19 PM

Hello Joshua,

We have previously experienced a similar problem when the viewer's resources were merged on the viewer's level rather than on the Window level. The search window of the viewer is a standalone WPF window. For that reason, it will look for the resources on the Window level.

You may try to merge the Resources as low as possible to the ReportViewer. For example:

<Grid>
    <Grid.Resourcves>
        <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Green/System.Windows.xaml" />
            <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Green/Telerik.Windows.Controls.xaml" />
            <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Green/Telerik.Windows.Controls.Input.xaml" />
            <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Green/Telerik.Windows.Controls.Navigation.xaml" />
            <ResourceDictionary Source="/Telerik.ReportViewer.Wpf.Themes;component/Themes/Green/Telerik.ReportViewer.Wpf.xaml" />
        </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Grid.Resources>
<ReportViewer />
</Grid>

If this does not work for you, can you please send me an isolated runnable project that reproduces the problem, so I can inspect it locally?

Regards,
Dimitar
Progress Telerik

Brand new Telerik Reporting course in Virtual Classroom - the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products. Check it out at https://learn.telerik.com/.
Tags
Report Viewer - WPF Styling
Asked by
Joshua
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or