-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sorting #12
Comments
It's a good question. No worries. First of all a small disclaimer: I didn't do sorting yet, because there wasn't such an use case in the personal projects in which I used data virtualization. But I did think of ideas how I would do it. I think you are on the right track. That's very much what I would come up with as well. For catching the sort event and intercepting with the custom logic (modifying the query & repopulating the virtualized collection) I have three approaches in mind that I'll sort by how promising they seem to me:
Further more I would recommend to make the Lastly, thank you for reaching out. It's difficult to tell, whether people are interested or even still use a project, if there is no feedback at all. Sorry that I couldn't help much. I always feel more confident in giving advise to things that I tried and tested myself. But feel free to ask again, if something is unclear or if you'll encounter difficulties. |
Thanks for your reply! The Sorting event is how I kinda started to go about it. Setting e.Handled to true makes it not do anything, and then I can set the SortDirection of the column and Reset() the collection. I think the ICollectionView thing would be the most elegant if you added it to the collection as a whole some day. The page fetcher would then get the info like you said and all could be easily handled that way.
Totally. I searched far and wide and couldn't find an existing solution to data virtualization at all, which is strange. Or at least none that isn't part of some expensive commercial package which is incompatible with GPL and such. Do so few people ever need large datasets? Seems strange. |
Indeed. I'll put some thought into it and give it a try. Knowing that someone can benefit of that is a great new motivation. ;) But still I can't promise quick results. If it works I'll extend the samples by one that can sort a
Maybe the case for a non-commercial segment application that works with a lot of data is too rare. I've implemented the data virtualizing collection for a budgeting app where all historic transactions should be listed in one DataGrid. But it probably was overkill, because I could have worked around by just showing data month by month. I just got hooked by the idea to write an own data virtualizing collection and had a lot of fun doing so. :) Data virtualization has a history of being pretty niche in .Net. There are two predecessors to this project that I can remember of:
Both projects seem abandoned by their original authors. That's partly the reason why I started this project on my own. But I learned a lot from them. Looking forward, this project might get old in near future as well. The UWP UI Framework even has dedicated interfaces IItemsRangeInfo and ISelectionInfo. So it looks like UWP's UI controls might be more supportive of data virtualization. But I've never worked on a UWP project and I have the feeling that WPF is still more popular. Didn't have a look into MAUI yet. |
Sounds great! Yeah I find it weird though. I love to collect a lot of data from various places for which something like this is always nice. I'd especially think that something like a generalized SQLite browser would have a lot of use for this. It's crazy to think that there's packages for almost any niche thing imaginary but not (many) for something that seems common like this. The problem with the commercial nature of some packages is also just that they are incompatible with GPL and that makes them just impossible to use for some projects. I did see that CodeProject thing while googling actually. That's how I ended up on your package in the end. I typed "VirtualizingCollection" into Nuget haha. I'm lazy like that, always like it when something is on Nuget. Which is ironic because I'm also too lazy to put any of my own stuff on Nuget. Heh. Never looked into UWP or MAUI either yet. I'd like something that is truly cross platform if I'm ever moving to something different. C# already is but UWP and MAUI both are limited in that regard I believe, with MAUI not supporting Linux. |
I am happy that you found my project. Maybe I should also think of some search engine optimization or make some kind of advertisement. :D If you haven't yet, I can recommend to have a look at Avalonia. It is an open source UI framework by the community (meaning no direct involvement of Microsoft). The syntax is based of WPF and it is cross platform. They support Windows, Linux, macOS, recently also Android, iOS and WebAssembly. I've already used it for smaller hobby projects. Not as fine-polished as WPF yet, but looks like they'll eventually get there. Maybe sooner than later. |
This may be a stupid question and out of the scope of this project, but let's say I bind this to a DataGrid and I use the collection to fetch data from an SQLite database.
What happens if I click on the sort columns in WPF? Ideally I would just catch that (so it doesn't try to manually request & sort millions of entries), modify the SELECT query, invalidate all the data in the collection, and then ask it to repopulate as it sees fit.
Do you have a solution in mind for this kind of situation?
The text was updated successfully, but these errors were encountered: