Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
85
How to check whether a UltraListView contains an item or not
posted

Dim mListView As New Infragistics.Win.UltraWinListView.UltraListView

mListView.Items.Add("Google","Google")

If Not mListView.Items().Contains("Google") Then
mListView.Items.Add("Google","Google")
End If

the above gives me error.

Parents
No Data
Reply
  • 23930
    Offline posted

    Hi,

    Thank you for contacting Infragistics Developer Support.

    What you could do in order to check if an item with specified key exists in the Items collection of UltraListView is to first use the Cast method in order to cast them to UltraListViewItem enumerable collection. Then use the Any method to see if item with such key exists.

    I have attached a simple sample demonstrating this approach.

    Please let me know if you have any additional questions.

    WLV_SearchForAnItem.zip
Children