schoetbi / XPTable

sourceforge.net XPTable clone with my patches
Other
53 stars 28 forks source link

Designer column model broken on .NET6 #49

Closed UFuz closed 1 year ago

UFuz commented 1 year ago

I know this project lies down for years now, but I would appreciate if someone could provide a fix for the designer. I am using this control on .NET6 x64 WF (VS2022) and it works still nice. There is an (hopefully easy to fix) issue with the designer of the column model, when editing the column collection, the drop down of the individual column types is not showing and when trying to add a column it returns with: "abstract class error".

On .Net 4x it works fine.

The annoying part is, that if I enter the designer of a form where XPTABLE is used, even not touching the column model, it will just wipe it, destroying the app's functionality. image

adarmus commented 1 year ago

Hi, I'm surprised it is still working in .Net 6, given that some Framework classes (ContextMenu) used by XPTable were removed in Core 3.1 - https://learn.microsoft.com/en-us/dotnet/core/compatibility/3.1?WT.mc_id=DT-MVP-5003235#removed-controls.

I can't create a .Net 6 WinForms project that can use XPTable, can you provide a working example in .Net 6 (not just form code, I also need to know all your package references)?

Adam

UFuz commented 1 year ago

Hi Adam,

in fact when I ported my project from .Net4->.Net6 I had to make some easy adjustments to XPTable code (I have a local copy of your latest repo):

Basically, I was looking at the compile errors and then went through one by one. Does this help to recreate the issue? Let me know if you need more info. XPTableNet6.zip

P.S: Did a quick diff of the changes and attached them

adarmus commented 1 year ago

Hi,

Thanks for the code and the explanation. I repeated the migration and dropped in the code changes you provided and can see exactly what you see. I can't find a way forward and unfortunately do not have much time spare to look into this. I did find some interesting articles on moving the VS designer to support .Net Core (https://devblogs.microsoft.com/dotnet/custom-controls-for-winforms-out-of-process-designer/). It looks like a substantial change (that is still in-progress), and any custom scenarios (like a custom collection editor) are not going to have a straight-forward migration path (possibly having to use a new SDK to create the design-time controls).

I'm afraid I'm going to have to leave this issue open, but will not be able to work on it myself.

Regards, Adam

UFuz commented 1 year ago

thanks for this link. It's far beyond my knowledge as I never did work on a custom control designer part. If you look here https://github.com/KlausLoeffelmann/NetControlDesigners/pull/6#issuecomment-1336462914 and scroll down to the "questions" it describes the exact same issue with the custom types and the "abstract" error.

This issue is now labeled CLOSED since a few days (https://github.com/microsoft/winforms-designer-extensibility/issues/6) but I guess it's nothing that will come out of the box so still manual work for XPTABLE is required to fix it. Still hoping anyone skilled to pick this up...

UFuz commented 1 year ago

Thanks to Armin and a company funding the transformation to .Net 6 was implemented: https://github.com/armin-pfaeffle/XPTable.Net