Avalonia Port of WPF DataGrid

Created on 12 Sep 2019  路  9Comments  路  Source: AvaloniaUI/Avalonia

The current version of the Avalonia DataGrid is based off the old Silverlight version. This was the best way to do it back then as no other source code was available with appropriate licensing. However, the Silverlight version has a number of issues compared to the WPF version which is more complete and tested. Instead of trying to fix the Silverlight implementation it is probably better to re-base the code on the WPF version. Then bug fixes can be applied in the WPF repository as well as Avalonia benefiting everyone.

https://github.com/dotnet/wpf/blob/master/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/DataGrid.cs

question

Most helpful comment

I do have an experimental DataGrid like control on my branch https://github.com/AvaloniaUI/Avalonia/tree/xdatagrid-experiment that doesn't use any prior code from WPF/Silverlight and is powered by ItemsRepeater. Still a WIP

image

All 9 comments

I would love to see that too the current version have so many bugs which is sucks!

We'll probably need to implement https://github.com/AvaloniaUI/Avalonia/issues/2769 and triggers first. That would radically simplify the porting process

Also there is DataTable from WindowsCommunityToolkit for UWP with open sourced code - https://docs.microsoft.com/en-us/windows/communitytoolkit/controls/datagrid
But I didn't use it and not sure, if it is better or worse than wpf version.

@Tirraon The WindowsCommunityToolkit is also using the Silverlight base for their DataGrid implementation. There are many issues with it as well and most have gone unfixed. The Silverlight version was never really at the level of the WPF one.

I do have an experimental DataGrid like control on my branch https://github.com/AvaloniaUI/Avalonia/tree/xdatagrid-experiment that doesn't use any prior code from WPF/Silverlight and is powered by ItemsRepeater. Still a WIP

image

@jmacato Having a light-weight alternative is definitely useful in some cases. But Avalonia benefits immensely from keeping the full featured DataGrid control as well.

I don't think that anyone of the Avalonia devs will have time soon to work on a rich DataGrid implementation. Contributions by the community are always welcome.

It is an extremely complex control (and frankly I hate its code and it'd be unmaintainable given the lack of resources and time on our part). But if someone can contribute with that then that'd be great.

All good points and I'm not saying this be attempted right now. I also realize how large DataGrid is.

It's possible a refactor would be allowed in the actual WPF repo and then once that's done the code would be more easily ported. I might be willing to take a stab at that myself but I think it's going to take at least until the 0.10 release for the Avalonia feature set to be ready to make porting controls like this reasonable.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

TheColonel2688 picture TheColonel2688  路  3Comments

MarchingCube picture MarchingCube  路  4Comments

akunchev picture akunchev  路  3Comments

RUSshy picture RUSshy  路  4Comments

georgiuk picture georgiuk  路  3Comments