We have a case where a new WPF dialog is being launched from a WinForms application (all the dialogs are slowly being refactored to WPF). The WPF Window has a XamSpreadsheet which contains a generated report which can be saved to an Excel doc. We are using v17.2 (but we have always seen this behavior with that control).
Something we are seeing is that when the report is set and displayed within the WinForm, and Windows has a high DPI setting (as many new machines come with by default), the row heights are squished. Other elements on the window don't seem to have any issues.
I have attached a screenshot and a sample app. Is there something I can do to improve the behavior?
SpreadsheetSample.zip
Hello Walter,
I have been investigating into this behavior you are seeing, and I have reproduced it. This appears to be specific to launching the XamSpreadsheet from a Windows Forms application, and in order to work around it, I would recommend that you use the Windows Forms spreadsheet control, the UltraSpreadsheet. You can read about this control here: https://es.infragistics.com/help/winforms/spreadsheet.
If using the UltraSpreadsheet is not an option, I would recommend that you set the DefaultColumnWidth and DefaultRowWidth properties on the Worksheets in the Workbook that you assign to the XamSpreadsheet such that they appear closer to your expected height and width.
This is unexpected behavior, and as such, I have asked our engineering staff to examine it further. To ensure this receives attention, I have logged this behavior in our internal tracking system with a development ID of 249294 and have created you a private support case so that you can be notified of a resolution to this issue when it becomes available. This support case has an ID of CAS-190750-H9R8M0 and you can access it at https://es.infragistics.com/my-account/support-activity.
I will be sending the initial update to that support case shortly. Please let me know if you have any other questions or concerns on this matter.
Sincerely,AndrewSoftware Developer
I work with Walter (who reported the original issue) and we're seeing a new issue that could be related to this bug fix.
The issue has to do with row selection. It's like the cell selection code thinks that there are two cells in each DPI-adjusted cell. For example, if you click the top half of any cell in row 1, the cell in row 1 is selected. If you click the bottom half of any cell in row 1, the cell in row 2 is selected. In the screenshot below you can see that the bottom of cell B3 has been clicked and B6 is the cell that ends up getting selected. The probably gets increasingly worse as you try to select cells lower in the spreadsheet.
I have only been able to reproduce the issue consistently in a test project under these criteria:
Set your DPI settings (sign out and back in to make sure they are fully "set"), open the sample solution and run the project "WindowsFormsApp", click Launch and then select rows in the spreadsheet and you should observe the above described behavior. I also have a WpfApp in the solution that I was trying to reproduce the issue with, but couldn't get it to happen predictably.
SpreadsheetSample_RowSelectionIssue.zip
NOTE: In our original issue we had a WinForms application that hosted a bunch of WPF windows and controls. We have since made the hosting application WPF and still see this new issue. We do still have a lot of WinForms in the application, so maybe it's just that some WinForms DLL gets loaded and throws everything off. I'm not sure what triggers it though, so hopefully if the attached sample behavior is fixed it will fix our real scenario.
ANOTHER NOTE: I have seen this behavior on occasion when docking/undocking my laptop. I am running mixed resolutions/DPIs though, so I'm not as worried about that. This issue may be more Windows 10 related than the XamSpreadsheet control. All the tests were performed undocked though as to simplify reproduction steps.
Thanks! Your controls are great and your support is awesome!
Jon
Here is a stackoverflow link with a comment about having the same issue: https://stackoverflow.com/a/21450169
Looks like there are some other suggestions that might work to get the DPI correctly.
Jon,
We responded to you in the XamSpreadsheet Cell Selection Incorrect under certain DPI Settings and WinForms thread.