'ExtensionAttribute <System.Runtime.CompilerServices.Extension()> _ Public Function IncludesCode(ByVal sc As e_SecurityCodes, ByVal DocSecurityValue As e_SecurityCodes) As Boolean If sc.HasFlag(DocSecurityValue) Then Return True End If Return False End FunctionThen for the Click:
Dim results As List(Of ListCol) = New List(Of ListCol)() Dim l1 As New ListCol() l1.Id = 1 l1.SecurityCodes = e_SecurityCodes.DMS_Accounting_AP results.Add(l1) Dim l2 As New ListCol() l2.Id = 2 l2.SecurityCodes = e_SecurityCodes.DMS_Accounting_AR results.Add(l2) Dim result_Match = (From x In results Where x.SecurityCodes.IncludesCode(e_SecurityCodes.DMS_Accounting_AP) Select x).ToList()(I mocked your ListCol class like so):
Public Class ListCol Private _securityCodes Public Property SecurityCodes As e_SecurityCodes Get Return _securityCodes End Get Set(ByVal value As e_SecurityCodes) _securityCodes = value End Set End Property Private _id Public Property Id As Integer Get Return _id End Get Set(ByVal value As Integer) _id = value End Set End Property End ClassSorry if this doesn't solve the problem - done in a rush .....