How to Sort WinForms DataGridView bound to EF EntityCollection

后端 未结 3 662
感动是毒
感动是毒 2020-12-18 06:27

I\'m trying to bind a WinForms DataGridView to an EntityCollection from an EntityFramework4 object. The trouble is, I can\'t figure out how to get it

3条回答
  •  难免孤独
    2020-12-18 07:26

    Thank you Andrew Davey, his blog has many other interesting things.

    Here a simple use of BindingListView (BLV) in Vb.net that works too:

    Imports Equin.ApplicationFramework
    
    Dim elements As List(Of projectDAL.Document) = db.Document.Where(
        Function(w)w.IdProject = _activeProject.Id).OrderBy(Function(i) i.Description).ToList
    
    Dim mySource As BindingListView(Of projectDAL.Document)
    mySource = New BindingListView(Of projectDAL.Document)(elements)
    

提交回复
热议问题