Textboxes Not Working
I have a WPF browser application that is utilizing a ReportViewer control to display SSRS reports. After printing one of these reports using the print function located within the control, the textboxes throughout the application will stop working. Even if the user opens a new page it will not allow them to type in the textboxes. The dropdown list, datagrids, and buttons still work fine. I have been attempting to duplicate this issue with no success and it is extremely intermittent for the users. I have found that if they open the application in a new tab it will work fine. Does anyone know that could be causing this issue?
Rikam PalkarPosted Apr 5, 2025, 6:25 PM
try Dispatcher
Muhammad Imran AnsariPosted Mar 24, 2025, 5:38 AM
Hello Jeremy,
Your issue likely occurs because the ReportViewer control steals focus after printing, preventing textboxes from receiving input, while other controls (dropdowns, grids, and buttons) remain functional. This can be due to WinFormsHost focus handling issues, browser compatibility (IE mode), or ReportViewer's rendering mode. To fix this, try manually restoring focus to a textbox using
Dispatcher.BeginInvoke(() => Keyboard.Focus(SomeTextBox), DispatcherPriority.ApplicationIdle);. Disabling focus onWindowsFormsHost(Focusable="False") can also help. Additionally, refreshing the ReportViewer after printing (reportViewer1.RefreshReport();) or switching to remote processing mode (ProcessingMode.Remote) may resolve the issue. If the problem persists, test in a different browser like Edge in IE Mode, or reload the ReportViewer as a workaround.Good Luck!
Sangeetha SPosted Mar 24, 2025, 4:48 AM
Focus Issues: The ReportViewer control might be causing focus issues after printing. You can try explicitly setting focus back to the textboxes after the print operation.
Event Handling: Ensure that there are no event handlers that might be interfering with the textboxes' functionality after printing. Check for any
GotFocusorLostFocusevents that might be causing this behavior.Threading Issues: Printing might be causing some threading issues. Ensure that all UI updates are being done on the main thread. You can use
Dispatcher.Invoketo ensure this.Control State: The state of the controls might be getting altered after printing. You can try resetting the state of the textboxes after the print operation.
Browser Compatibility: Since opening the application in a new tab works fine, it might be related to browser compatibility or session state. You can try clearing the browser cache or testing in different browsers.
Amira BedhiafiPosted Mar 23, 2025, 9:54 PM
Your issue is likely related to focus or input capture being disrupted after the ReportViewer print function is used. The ReportViewer control may be interfering with the WPF application's input system (for example keyboard focus or message pump).
So try updating the ReportViewer control to the latest version, and consider explicitly resetting keyboard focus (using
Keyboard.ClearFocus()or setting focus to a known control) after printing.