I have a scenario. I have a list of user id's displayed on the windows form. As soon as I click one of the user id's I go and get the user details from the DB. To retain the responsiveness of the application, on selection changed event of the listbox, I create new BackgroundWorker(BW) objects and hit the DB. I show 'Searching user 'abc'...' in the status bar.
Now, if the user moves between the user ids using arrow keys (4-5 times), by above design I have created multiple BW objects to make the request. But finally when the data comes back for particular user (which may not be the one where user is currently selected in the listview), since it was async call, I still end up displaying all the users in the status bar.
What I would like to do is, I want to go and get the details only for the last user. Till that time I want to display 'Searching user...' only.
Please let me know solution for this...