none
How to filter DataGridView in WinForms when using .Local.ToBindingList() RRS feed

All replies

  • Hi SeC,

    Welcome to MSDN Forum.

    In the article you posted, it introduces that Local property will return an ObservableCollection<T>, so you using 'where' to filter records as well, and then call ToBindingList method.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Monday, July 9, 2012 4:19 AM
    Moderator
  • This doesn't answer the poster's question. How can we filter local data, then bind to it?
    Tuesday, August 28, 2012 3:11 PM
  • Hi SeC,

    Welcome to MSDN Forum.

    In the article you posted, it introduces that Local property will return an ObservableCollection<T>, so you using 'where' to filter records as well, and then call ToBindingList method.

    Best Regards


    Allen Li [MSFT]
    MSDN Community Support | Feedback to us

    Problem is - there's no .ToBindingList() to call on IQueryable/IEnumerable - so it's not as simply as .Local.Where(...).ToBindingList()
    Monday, January 21, 2013 12:57 PM
  • You can use a where before you call Load, so that only the data you want is in the local property before calling ToBindingList on it. Something like:

    db.Users.Where(x=>x.IsLocked).Load();

    So instead of filtering what comes out of local you filter what goes in. Does that solve your issue?


    We are seeing a lot of great Entity Framework questions (and answers) from the community on Stack Overflow. As a result, our team is going to spend more time reading and answering questions posted on Stack Overflow. We would encourage you to post questions on Stack Overflow using the entity-framework tag. We will also continue to monitor the Entity Framework forum.

    Monday, February 4, 2013 9:20 PM
    Moderator
  • Hi.

    This only works first time - second time .Load() does nothing. I need full collection in .Local, then filter it and then bind it.

    Tuesday, May 14, 2013 9:28 AM
  • Hi.

    This only works first time - second time .Load() does nothing. I need full collection in .Local, then filter it and then bind it.

    hello, I have the same problem, someone help me?
    Wednesday, November 18, 2015 10:41 PM
  • Hi.

    This only works first time - second time .Load() does nothing. I need full collection in .Local, then filter it and then bind it.

    hello, I have the same problem, someone help me?

    http://aviadezra.blogspot.com/2009/08/mvp-mvvm-winforms-data-binding.html

    http://www.codeproject.com/Articles/88390/MVP-VM-Model-View-Presenter-ViewModel-with-Data-Bi


    Wednesday, November 18, 2015 11:49 PM