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 4618380
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:15:31+00:00 2026-05-22T02:15:31+00:00

Consider following situation: there is ComboBox and a filter TextBox, then user types a

  • 0

Consider following situation:
there is ComboBox and a filter TextBox, then user types a text in a text box ComboBox items source is updated using filter text. Everything works, but filtering occurs on every typed letter. I want to add a delay before filtering occurs (filter is not applyed while user is typing). What is the simpliest way to do it?

  • 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-05-22T02:15:31+00:00Added an answer on May 22, 2026 at 2:15 am

    The most used way of doing this is introducing a timer where everytime the user enters a new character your timespan get’s reset but if it is longer than x seconds then execute the code.

    Remember to do it async so that if the user starts typing again while you are performing a search you can cancel the async call as that information will now be outdated.

    If you are using a viewmodel just change textbox1_TextChanged to the appropriate Properties setter

    private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
        {
            if (!tmr.Enabled)
            {
                tmr.Enabled = true;
                tmr.Start();
            }
    
    
            TimeSinceType = DateTime.Now;
    
        }
    
    public DateTime TimeSinceType { get; set; }
    
    protected void Load()
    {
          tmr = new Timer();
          tmr.Interval = 200;
          tmr.Elapsed += new ElapsedEventHandler(tmr_Elapsed);
    }
    
    void tmr_Elapsed(object sender, ElapsedEventArgs e)
    {
        if ((DateTime.Now - TimeSinceType).Seconds > .5)
        {
            Dispatcher.BeginInvoke((Action)delegate()
            {
                //LoadData();
                tmr.Stop();
            });
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Consider the following situation: There is an xml that contains data @XmlData The @XmlData
Consider the following situation: There is a serialization file, created by the older version
Lets consider the following situation. There is products_controller which can be accessed from Admin
Consider the following situation. I've 2 types of backgrounds: 1.Photoshop gradients for which I
Consider the following situation Code was added to the trunk at revision x A
Consider the following situation: WidgetCompany produced a .NET DLL in 2006 called Widget.dll, version
Consider the following situation: We have two Localizable.string files, one in en.lproj and one
Consider following scenario: I have RESTful URL /articles that returns list of articles user
Consider the following situation: class MyFoo { public: MyFoo(); ~MyFoo(); void doSomething(void); private: unsigned
Consider the following situation: - Suppose my app allows users to create the states

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.