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
20
Infragistics ValueListItems.Contains method doesnt work
posted

Hi,

 

Can any one tell me y contain method of ValueListItem does not work. I am trying to find a valuelistitem using

this

 

.ultraGrid2.DisplayLayout.ValueLists[MyValueList].ValueListItems.Contains(v1) where v1 is ValueListItem but it always gives me false.

While the same works fine if add any new valuelistitem and then try to find it.

ValueListItem.Remove() also works fine but not contain().

Please Help.

Parents
No Data
Reply
  • 69832
    Offline posted

    The only explanation I can think of is that the item is not in the collection. The Contains method will do a reference comparison, so if you create a ValueListItem instance with the same DataValue and DisplayText as one that exists in the collection, and pass that into the Contains method, it should not and does not return true since they are two different instances.

Children