Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8883627
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:51:37+00:00 2026-06-14T20:51:37+00:00

how can i search and filter close string in listview. for example i have

  • 0

how can i search and filter close string in listview.

for example i have two column in my listview and both are bindable.

let say the first column named bindlname and second column name as “bindfname“

for example this is my listview record:

enter image description here

now if ever i type “Y and hit search button. it will filter YU ZIQ and FEAGS YAPSLE
all first letter in lastname and firstname that starts with letter “Y” will be filtered… another if every i will type “UY” it will display UY QILUZ and UY ZKAE

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:51:38+00:00Added an answer on June 14, 2026 at 8:51 pm

    You can use ICollectionView to binding your data to ListView and when you press the button you can filter this data.

    Sample code:

    public class Person
        {
            public string Name { get; set; }
            public string Surname { get; set; }
        }
    
        public class MainViewModel : NotificationObject
        {
            public MainViewModel()
            {
                SearchPerson = new DelegateCommand(this.OnSearchPerson);        
    
                // test data
                _myDataSource.Add(new Person { Name = "John", Surname = "Blob" });
                _myDataSource.Add(new Person { Name = "Jack", Surname = "Smith" });
                _myDataSource.Add(new Person { Name = "Adam", Surname = "Jackson" });
            }
    
            private List<Person> _myDataSource = new List<Person>();
    
            private string _searchString;
            public string SearchString
            {
                get { return _searchString; }
                set { _searchString = value; RaisePropertyChanged(() => SearchPerson); }
            }
    
            private ICollectionView _people;
            public ICollectionView People
            {
                get { return CollectionViewSource.GetDefaultView(_myDataSource); }           
            }
    
            public ICommand SearchPerson { get; private set; }
            private void OnSearchPerson()
            {
                if (!string.IsNullOrEmpty(SearchString))
                {
                    People.Filter = (item) => { return (item as Person).Name.StartsWith(SearchString) || (item as Person).Surname.StartsWith(SearchString) ? true : false; };
                }
                else
                    People.Filter = null;
            }
        }
    

    XAML file:

     <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>
    
            <StackPanel Orientation="Horizontal">
                <TextBox Text="{Binding SearchString}" Width="150" />
                <Button Content="Search" Command="{Binding SearchPerson}" />
            </StackPanel>
    
            <ListView Grid.Row="1" ItemsSource="{Binding People}">
                <ListView.View>
                    <GridView>
                        <GridView.Columns>
                            <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Name}" />
                            <GridViewColumn Header="Surname" DisplayMemberBinding="{Binding Surname}" />
                        </GridView.Columns>
                    </GridView>
                </ListView.View>
            </ListView>
        </Grid>
    

    Here is complete example (ListViewSearch.zip).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I use a a search filter to display users of a specific
I have a search form where user can search for products within their specified
I have this query where I can search the TABLE_GLOBAL_PRODUCTS $catglobal_sql = select p.*,
i have a search page in my site, where user can search all the
How can I modify JIRA's Quick Search filter? Currently it defaults to searching only
I have an EditText and Custom ListView Adapter connected sqllite db. I can add,
Can I place the Show entires filter in the search filter under the table
Let's say I got some values from GET from an url. How can I
I build one search filter, in that filter users can filter using different fields
Can search engines such as Google index JavaScript generated web pages? When you right

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.