osyris zosar

osyris zosar

  • NA
  • 289
  • 27.1k

how to see if Listview column contains a specific name

Dec 12 2020 4:41 PM

I have created a ListView with multiple columns

(This is a part of the Xaml)

  1. <ListView.View> <GridView> <GridViewColumn Width="100" Header="Indexer" DisplayMemberBinding="{Binding Number}"/> <GridViewColumn Width="100" Header="Name" DisplayMemberBinding="{Binding NameId}"/> <GridViewColumn Width="100" Header="Age" DisplayMemberBinding="{Binding Age}"/> </GridView> </ListView.View>  
cs part:

  1. public class MyItem { 
    public int Number { getset; } 
    public int Age { getset; } 
    public string NameId { getset; } 
    }  
i know how to add a new item to a specific column:
  1. AccountList.Items.Add(new MyItem { Age = Convert.ToInt32(AgeVAlue), NameId = NameValue.ToString(), Number = ListCount });  
how do i check if NameId contains a spefic word because i cannot do this:
  1. AccountList.Items.Contains(SpecificWord)  


Answers (4)