Text Box not Enabled Telerik Reports (WPF)

1 Answer 121 Views
Styling
Mark
Top achievements
Rank 1
Mark asked on 12 May 2021, 07:38 PM | edited on 16 May 2021, 06:40 PM

I have a Winforms App Where I am binding Telerik WPF ReportViewer control onto a Winforms app....

It quite nearly works.

All the Binding Works for my Telerik report But 'Find' ComboBox Is not working as well as when we embed into a WPF Application?

**** UPDATE I found that the Find COMBO Box is Enabled It is, however, Only accepting <SPACE> <BACKSPACE> <CTRL-V> of course I want this limitation removed.  Meaning if I pasted any Search Terms in to the Dialog box Telerik will find the items in the Report****

I have proven binding by using Visual Property Live Inspector to modify Token Value at runtime. When I modify Token in Visual Studio Live Property Editor it searches report and then highlights as requested. If you can tell me what i must do to enable the Find Text Box the Software will be now be deliverable. Follow the Yellow Higlighted areas in attached pic with word "When" in the Live Visual Property Editor

*** UPDATE ***

I have since learned that where Modeless Operations are required when WPF is being embedded in a Winforms App The Modeless Window (ie your Find Window) must Call  the static Method

ElementHost.EnableModelessKeyboardInterop(Window) Method

Does the Telerik.Reporting.Wpf Have property that in turn issues this important API Call so that the Search Window will work modelessly and correctly inside a Winforms Host?

Kind Regards,

Mark

 

 

 

1 Answer, 1 is accepted

Sort by
0
Todor
Telerik team
answered on 17 May 2021, 01:49 PM

Hi Mark,

We are aware of the described problem. This behavior is reproducible with the native WPF classes so it's not related to Telerik Reporting or Telerik WPF controls. Apparently, ElementHost has problems with key events, as discussed in various forums. For example, Keyboards inputs in a WPF user control are not sent to the WinForms container or MDI app Menu Shortcut keys getting swallowed when form with WPF ElementHost is active.

The observed behavior is valid only when the windows are non-modal. When a window is opened, the keystrokes get swallowed by the ElementHost and do not get propagated to the contents of the window. When the window is opened with "ShowDialog()", the key events are propagated correctly. However, in our code, the ReportViewer calls the SearchDialog with "Show()", because the Search window is designed to be modal-less, so the user will be able to navigate through the report with the Search window opened. Currently, there is no event that can be used to open the Search dialog in modal mode, but we will consider adding such an event so the users would be able to use it in similar scenarios.

Unfortunately, we were unable to find a straightforward workaround for this scenario. A possible solution would be to monitor the application's windows collection and once the Search dialog appears, change its style to Modal through reflection, but we haven't tested this approach and cannot ensure you it will work.

Previously, another user has passed the Telerik Search Dialog to a delegate on his Windows Form to execute the "EnableModelessKeyboardInterop" method in a custom solution and this corrected the issue. The code for finding the search dialog was not that straightforward though.

Another possible workaround includes substituting the SearchCommand binding in the Telerik.ReportViewer.Wpf.xaml with a custom command. You may have to use reflection to call the original SearchCommand from the ReportViewerModel because the model is not public.

Regards,
Todor
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Mark
Top achievements
Rank 1
commented on 17 May 2021, 04:40 PM

Well we are not requesting the Modal method. What we need you to do is add a dependency property "IsHostedInWinforms" That your users can set in XAML. If that property is true then all Telerik needs to do is call EnableModelessKeyboardInterop(WPF Window) And This known bug in Telerik will be fixed.
Todor
Telerik team
commented on 18 May 2021, 12:44 PM

Our local tests showed that the problem is reproducible with the native WPF classes and for that reason, we don't consider it a Telerik bug.

Feel free to log the requirement as a feature request in our public feedback portal. This will let the other users interested in this feature vote for it and increases its priority.

Tags
Styling
Asked by
Mark
Top achievements
Rank 1
Answers by
Todor
Telerik team
Share this question
or