Filtering, Sorting, and Grouping w/ Collection Views - EASY WPF (.NET CORE)

Sdílet
Vložit
  • čas přidán 7. 09. 2024

Komentáře • 38

  • @omostan
    @omostan Před měsícem

    As always, this is another awesome tutorial. Thank you very much for the great explanation 👍

  • @riyadamrani
    @riyadamrani Před 3 lety +3

    Much needed tutorial thank you !

  • @VinuP2023
    @VinuP2023 Před 3 lety +2

    Thank you so much for making this video. :)

  • @kritikyorumer
    @kritikyorumer Před 2 lety +1

    Thanks Sean!

  • @nikolaidavydov7523
    @nikolaidavydov7523 Před 2 měsíci

    thanks! perfect lesson

  • @PythonHarry
    @PythonHarry Před 4 měsíci

    explains a lot, thanks

  • @basharfocke
    @basharfocke Před 8 měsíci

    another perfect lesson.

  • @amryakout2957
    @amryakout2957 Před rokem

    Great work 👏

  • @ohnomyhandleistaken
    @ohnomyhandleistaken Před 3 lety +1

    Sean, your videos are always extremely helpful and I've learned a lot from them. I have one question: What happens if the ObservableCollection is loaded async into an async ViewModel, like in your MVVM full stack episode #4 ? Having tried this, the ObservableCollection gets hydrated after the view model is returned, so placing the CollectionViewSource initialization in the ViewModel constructor or the static "factory" method you create in that episode results in the CollectionView never getting populated. What would be an elegant solution for this ?

  • @longuinni
    @longuinni Před 3 lety +3

    Really nice!! I did something very similar in my application. But how to highlight the search text? Maybe a style inside the xaml listview?

    • @SingletonSean
      @SingletonSean  Před 3 lety +2

      Hmm I could see how that would be helpful. I'm interested in how something like that would be implemented. Good questions Fernando, I'll have this in the back of my mind.

    • @longuinni
      @longuinni Před 3 lety +1

      @@SingletonSean Yes, because if you have a large data table with long phrases it's hard to see why that result was filtered.

  • @2005bgva
    @2005bgva Před 2 lety

    Thanks SingletonSean for this video, could you please activate subtitles? please please.

  • @MohammadGolara
    @MohammadGolara Před 5 měsíci

    How is it possible to make a new DataGrid and show how many for example Doctor is in list?

  • @kentswan3230
    @kentswan3230 Před 3 lety

    My application views are eventually bound to a database search query collection which is a subset of the entire db as filtered by the query. This can still be a lot of data. The resulting query has many more useful column elements than I want to display at first. What I actually would actually like to be able to do is selectively enable a subset of those data columns making them visible then have a user control which can dynamically enable/disable the visibility of other columns having useful data by using some sort of column enable/disable visibility selector mechanism.

    • @SingletonSean
      @SingletonSean  Před 3 lety

      Hey Kent, I've seen this use case implemented before. As you've probably already discovered, there is no Visibility property on GridViewColumns. The best alternative to hide a GridViewColumn is to set the Width to 0 and set the GridViewColumnHeader's IsEnabled to false to prevent resizing. That said, you could bind these 2 properties to a checkbox with converters. Hope that helps spark some ideas, Kent!

    • @kentswan3230
      @kentswan3230 Před 3 lety

      @@SingletonSean Thanks. That is an approach that I will try to see how well it might work.

  • @amryakout2957
    @amryakout2957 Před rokem

    I want to make filtering to datagrid with datatable or dataview not observable collection.i try it but the datagrid didn't updated anywhere

    • @amryakout2957
      @amryakout2957 Před rokem

      I am working on mvvm with sql database and want to make text box filer for the data grid . I benefited alot from your channel

  • @user-xg7hi5mh3g
    @user-xg7hi5mh3g Před rokem

    Hi thank u so much for your time&efforts here but I have a qst : List and every single Room have some Desktop so my List is a list of a list of Desktop how i could visualize all of this in a listBox with the template of subItem that mean that i see something like this:
    Room a
    Desktop 101
    Desktop 104
    Room b
    Desktop 234
    Desktop 123
    Desktop 453
    Desktop 498
    Room c
    Desktop 365
    Desktop 908
    Desktop 187
    Room d
    Desktop 007
    Room n
    Desktop 980
    Desktop 1001
    As we know in the list they re already grouped by a room ;)
    I am using json for import the list
    In a Wpf desktop app
    Thank u in advice

  • @apeshape01
    @apeshape01 Před 2 lety

    Hi Sean - thanks once again for your great video. I’ve followed your 4 hour video on creating a .net 5 MVVM WPF app, applying the principles to my use case. I now need to filter the list view via a text box and was going to use your video but it seems ICollectionView isn’t available in .net 5 or 6. Are you aware of what alternatives are available? I’ll continue searching but perhaps a side tutorial extending the CZcams viewers app with this capability would be brilliant. I completely understand if you’re busy on other projects though. Thanks for your time. Roy

    • @SingletonSean
      @SingletonSean  Před 2 lety

      Hello Roy! I am on .NET 6 and am able to use ICollectionView. Are you able to import System.ComponentModel?

    • @apeshape01
      @apeshape01 Před 2 lety

      Hi @@SingletonSean - that is strange. Yes I can import System.Component model namespace into my view model class but ICollectionView doesn’t come up. I’m using .Net 6 too. The Microsoft api doc doesn’t list any core or .net versions in the Applies to section. I wonder how you’ve been able to get it to work

    • @TheInevitable360
      @TheInevitable360 Před rokem

      Same issue here. have you found any solution to this issue?

  • @_SkyDancer
    @_SkyDancer Před 2 lety

    How to use this CollectionView if I bind to the Model in the code-behind like this:
    var newBinding = new Binding(string.Format("[{0}]", i));
    var currentColumn = new DataGridTextColumn
    {
    Binding = newBinding,
    Header = header
    };
    MyDataGrid.Columns.Add(currentColumn);

    • @_SkyDancer
      @_SkyDancer Před 2 lety

      The solution is - it works the same way just need to re-create and refresh collectionView after each Serialization

  • @ShinyBorel
    @ShinyBorel Před 3 lety

    Very nice video, have you found a good solution for sorting groups? The best way I've got is making sure to populate the collection in the right order. But that's not dynamic or often even possible.

    • @SingletonSean
      @SingletonSean  Před 3 lety

      Hey ShineyBorel, I've actually never run into this kind of requirement in an application, but I am interested in messing around with this and seeing if there's a way to sort groups.

  • @iftaker1
    @iftaker1 Před 3 lety

    I was wondering if you can apply the same concept on Treeview?

    • @SingletonSean
      @SingletonSean  Před 3 lety

      Yep, I've used this before on a TreeView ItemsSource.

  • @mrt7948
    @mrt7948 Před 2 lety

    Can I dowoad the source code?

  • @laljigoti3711
    @laljigoti3711 Před 3 lety

    love your contribute and learnt a lot...first time I have spended thru paypal @lalji Goti ....Thanks

    • @SingletonSean
      @SingletonSean  Před 3 lety

      Thanks so much Lalji, the contributions are greatly appreciated! I'm glad my content is helping you as well.

  • @aminejadid2702
    @aminejadid2702 Před 3 lety

    Maybe you should use Rx.Net

    • @SingletonSean
      @SingletonSean  Před 3 lety +1

      Started getting into Rx a lot more recently, I love it! I agree, filtering is a pretty good use case for Rx.