VB-APP: LINQ to SQL class, IBindingListView properties and AutoFiltering DGV columns

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KodeKrazy
    New Member
    • Mar 2008
    • 32

    VB-APP: LINQ to SQL class, IBindingListView properties and AutoFiltering DGV columns

    Code:
    Public Sub fillItemSearch()
            Dim ProdDBfill As New linqFillItemSearchDataContext
            frmSearchItems.dgvSearchItems.DataSource = ProdDBfill.fillItemSearchDGV.ToList
        End Sub
    I have a LINQ to SQL class called linqFillItemSea rch. On the SQL Server 2005 there is an sp called fillItemSearchD GV which simply creates a View containing the columns that are needed to populate the dgv. The dgv is bound @ design time to the QryItemsFillSea rchBindingSourc e. My question is: Is this type of Binding Source, using a LINQ to SQL class, bound to an IBindingListVie w implementation?

    If so, how do I go about setting the IBindingListVie w.SupportsFilte ring to True?

    Also, when I set the Column Type of the dgv to DataGridViewAut oFilterTextBoxC olumn the app returns a "The DataSource property of the containing DataGridView control must be set to a BindingSource." error. Obviously, at least to me, it is bound both early and late, so how does it "forget" that it IS bound? It only throws this error when I try to use the AutoFilter on the columns of the dgv. It works fine when I have the column type set to DataGridViewTex tBoxColumn.

    So... From that I would surmise that since to support filtering, the BindingSource must be bound to an IBindingListVie w with a SupportsFilteri ng property, that this type of object doesn't possess this property. HOWEVER, there is an error trap that traps this specific error and returns the message "DataSource is not an IBindingListVie w or does not support filtering", which is not being thrown. "Curiouser and curiouser".

    As always, any help, is greatly appreciated...

    KK
Working...